URL Encoder & Decoder β€” Encode, Decode & Parse URLs Instantly

Paste text to encode for URLs, paste encoded strings to decode them, or drop a full URL into the parser to see every component broken down, decoded, and editable.

Spaces:
Plain Text0 chars
Encoded Output
Encoded output appears here…

What Is URL Encoding?

URL encoding, also called percent-encoding, is the process of replacing characters that aren't allowed in URLs with a % followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20 and an ampersand becomes %26. This is defined by RFC 3986 and is essential for constructing valid URLs that contain special characters, international text, or reserved characters used as data.

encodeURIComponent vs encodeURI

JavaScript provides two URL encoding functions that confuse many developers. encodeURI() encodes a complete URL while preserving characters that have structural meaning (/ ? # & =). Use it when you have a full URL and want to make it safe without breaking its structure. encodeURIComponent() encodes everything except unreserved characters β€” use it when encoding a single component like a query parameter value. Using the wrong one is a common bug: if you use encodeURI on a query value containing &, it won't encode it, breaking your URL structure.

The Space Encoding Debate: %20 vs +

Both %20 and + represent spaces in URLs, but they come from different standards. %20 is the RFC 3986 standard and works everywhere. + comes from the older application/x-www-form-urlencoded format used by HTML form submissions. In practice, most servers accept both in query strings. Use %20 as the default β€” it's more universally compatible, especially in path segments where + is treated as a literal plus sign.

Common Use Cases

βœ“API Query Strings: Encode parameter values when building REST API requests
βœ“OAuth Redirect URIs: Callback URLs must be fully encoded when passed as query parameters
βœ“UTM Parameters: Marketing campaign names with spaces and special characters need encoding
βœ“File Paths: Encode paths with spaces, accented characters, or special symbols
βœ“International URLs: Non-ASCII characters (emoji, CJK, accented letters) require percent-encoding

100% Client-Side β€” Your Data Stays Private

All encoding, decoding, and URL parsing runs entirely in your browser using native JavaScript APIs. No data is ever sent to a server, stored, or logged. This makes it safe to encode sensitive values like API keys, authentication tokens, OAuth callback URLs, and query strings containing personal data. Close the tab and everything is gone.

Frequently Asked Questions

What is URL encoding?
URL encoding (percent-encoding) replaces characters not allowed in URLs with % followed by two hex digits representing the byte value. Spaces become %20, ampersands become %26. Defined by RFC 3986.
What’s the difference between encodeURI and encodeURIComponent?
encodeURI() preserves URL structure characters (/, ?, #, &, =) β€” use for full URLs. encodeURIComponent() encodes everything except unreserved chars β€” use for individual values like query parameters.
Should I use %20 or + for spaces?
%20 is the RFC 3986 standard and works everywhere. + comes from HTML form encoding (application/x-www-form-urlencoded). Use %20 as default β€” it’s more universally compatible.
What is double encoding and how do I fix it?
Double encoding happens when you encode an already-encoded string. A space becomes %20 first, then %2520. This tool detects double-encoded strings and offers to decode them the correct number of times.
Is my data safe?
Yes. All encoding and decoding happens entirely in your browser using JavaScript. No data is sent to any server, stored, or logged. Safe for encoding API keys, tokens, and passwords.
What characters need URL encoding?
Everything except unreserved characters: A-Z, a-z, 0-9, -, _, ., ~. Reserved characters like /, ?, #, & only need encoding when used as data, not as URL structure.
Can I parse and edit URL components?
Yes. The URL Parser tab breaks any URL into protocol, host, port, path, query parameters, and fragment. Each part is color-coded and editable β€” change any part and the URL rebuilds in real time.
Can I encode/decode multiple strings at once?
Yes. The Batch tab processes up to 100 lines at once. Lines with errors are flagged individually without affecting the rest.

Related Tools

Related Tools