Encode & Decode URLs
Instantly Online
Encode or decode URLs and query strings instantly. Also parse any URL into its components and build custom query strings with the visual builder.
📖 How to Use
⚡ Why Use This URL Encoder?
3 Encoding Types
encodeURIComponent, encodeURI (full URL) and form encoding (+ for spaces).
URL Parser
Break any URL into protocol, domain, port, path, query params and hash.
Query Builder
Add key-value pairs visually and auto-generate a properly encoded URL.
Diff Highlight
See exactly which characters were encoded — changed parts are highlighted.
Mobile Friendly
Works perfectly on phones and tablets — great for debugging on the go.
100% Free
No login, no ads, no limits — free forever.
❓ Frequently Asked Questions
🔗 Related Tools
URL Encoder & Decoder: Percent-Encode or Decode Any URL Instantly
URLs can only safely contain a limited set of characters — spaces, ampersands, and many symbols need to be converted into a percent-encoded format before they'll work reliably in a link or query string. A URL encoder and decoder handles this conversion both ways, along with breaking a URL into its parts or building one from scratch.
What Percent Encoding Actually Does
Percent encoding (the formal name for URL encoding) replaces unsafe or reserved characters with a % followed by two hexadecimal digits representing that character's byte value. A space becomes %20, an ampersand becomes %26, and an equals sign becomes %3D. This ensures the character is preserved exactly, without being misinterpreted as part of the URL's structure — an unencoded & inside a value, for example, would be read as the start of a new query parameter.
encodeURIComponent vs encodeURI: Which One to Use
This tool offers three encoding modes, matching the standard JavaScript functions developers already know:
- encodeURIComponent — encodes everything except letters, digits, and a small set of safe symbols. This includes encoding characters like
/,?,&, and=, which is exactly what you want when encoding a single value that will be placed inside a query string. - encodeURI (full URL) — preserves URL structure characters (
/,?,&,=,:) so it doesn't break an already-formed URL, but still encodes characters that shouldn't appear anywhere in a URL, like spaces. - Form encoding (+ for space) — matches the format browsers use when submitting HTML forms, encoding spaces as
+instead of%20. This is still used by some older APIs and form submissions.
A common mistake is using encodeURI on a single parameter value — since it won't encode & or =, a value containing those characters will break the query string. Use encodeURIComponent for individual values, and encodeURI only when encoding a complete, already-structured URL.
Breaking Down a URL with the Parser
Beyond simple encoding, this tool can parse a full URL into its components — protocol, hostname, port, path, query string, and fragment — which is useful for debugging why a link isn't working as expected, or for understanding an unfamiliar URL's structure before modifying it. Query parameters are also automatically decoded and listed individually.
Limitations to Keep in Mind
- Decoding a string that wasn't validly percent-encoded (a stray % not followed by two hex digits, for example) can cause a decode error — the tool falls back to a legacy decoding method in that case, but the result may not be fully accurate for malformed input.
- The URL Parser requires a properly structured URL, including a protocol; if you paste a bare domain without
https://, the tool adds it automatically, but this assumption may not always match your intended URL. - Encoding and decoding happen directly in your browser using JavaScript, so there's no need to send your URLs or data to a server to get a result.
Related Tools You Might Need
Once your URL or query string is ready, the QR Code Generator can turn it into a scannable code. If you're working with structured data alongside a URL, such as an API response, the JSON Formatter can help validate and format it.
Frequently Asked Questions
What's the difference between URL encoding and percent encoding?
They're the same thing — "percent encoding" is the formal technical name, while "URL encoding" is the more commonly used everyday term. Both refer to the same character-replacement process using the % symbol.
Why did my query parameter break when I used encodeURI instead of encodeURIComponent?
encodeURI deliberately leaves characters like & and = unencoded, since it assumes you're encoding a complete URL where those characters are structurally meaningful. If your value itself contains an & or =, encodeURI won't protect it, and it will be misread as a new parameter. Use encodeURIComponent for individual values instead.
Can I build a URL with multiple query parameters at once?
Yes — the Query Builder mode lets you enter a base URL and add multiple key-value pairs, automatically encoding each one correctly and joining them with &.
What does form encoding (+ for space) mean in practice?
It's the encoding style browsers use for standard HTML form submissions (application/x-www-form-urlencoded). It behaves like encodeURIComponent except spaces become + instead of %20. Use it when matching a system that specifically expects this format.