URL Encoder & Decoder — Convert Text to URL-Safe Format
Encode text for URLs or decode encoded URL values.
Why use this tool
01Convert between readable text and percent-encoded URL values in the browser.
URL Encoder converts text into percent-encoded URL-safe form (or back). Useful when you need to embed values into a query string, redirect URL, or any context where reserved characters would otherwise break parsing.
Encoding rules differ depending on context — whether you're encoding a full URL, a single component, or an entire path. This tool handles both encodeURI and encodeURIComponent semantics so you can pick the right one for your case.
Pair it with our URL Parser to inspect what an encoded URL actually contains, or with Query String Builder if you're constructing query strings from scratch.
How to use
02Quick checks before you copy
03Confirm the input is the format you intended.
Scan the result before using it in a document, URL, config, or message.
Copy only the output you need.
Use Cases
When passing a redirect URL as a query parameter (?return=https://example.com/path?x=1), the inner URL must be encoded so its ?x=1 doesn't get parsed as part of the outer URL. Use component-level encoding.
Spaces, accented characters, and emoji aren't valid in query strings as-is. Encode them to percent-encoded form (e.g., space becomes %20) so the URL survives every HTTP client, proxy, and server log.
When a value has been encoded twice, %20 becomes %2520. If a decoded URL still contains %25 patterns, decode it once more — double-encoding is a common bug across redirect chains and template engines.
Some chat tools (Slack, Teams, email clients) break URLs that contain parentheses, commas, or non-ASCII characters. Encode the path or query value to produce a link that survives any clipboard or messenger.
Tips & Tricks
- 01Encode components, not whole URLs, when building query values
Use component encoding for individual parameter names and values so reserved URL separators keep their meaning.
- 02Watch for double encoding
Values containing %2520 often mean a space was encoded twice. Decode once and verify before shipping links.
- 03encodeURI vs encodeURIComponent
encodeURI assumes you're encoding a complete URL — it leaves reserved characters like /, ?, &, =, # alone. encodeURIComponent assumes you're encoding a single value — it encodes those characters too. Use the latter for query values, the former for whole URLs.
- 04Plus signs and spaces are not the same
In query strings, + sometimes represents a space (legacy application/x-www-form-urlencoded), but %20 always represents a space. When encoding a value, always use %20 to avoid ambiguity — many parsers no longer interpret + as space.
- 05Reserved vs unreserved characters
RFC 3986 defines unreserved characters as A-Z, a-z, 0-9, hyphen, underscore, period, tilde. Everything else is reserved and must be encoded if its raw meaning could conflict with the URL syntax.
- 06Hashes (#) start fragments — they're never sent to the server
If you encode # as part of a value, the URL won't include it in the request fragment. If you want a # to be sent as data, you must encode it as %23.
FAQ
04What's the difference between encodeURI and encodeURIComponent?
encodeURI is for encoding a complete URL — it preserves reserved URL characters (/, ?, &, =, #) so the URL structure stays intact. encodeURIComponent is for encoding a single component (like a query value) — it encodes those reserved characters too, so they're treated as data, not as URL syntax.
What characters are left unencoded?
Per RFC 3986, the unreserved characters are A-Z, a-z, 0-9, and the four marks: hyphen, underscore, period, tilde. Everything else is encoded as percent-encoded bytes. The four characters - _ . ! ~ * ' ( ) are kept by encodeURIComponent specifically.
Does it encode the entire URL or just a value?
Both — pick the mode that matches your case. For encoding the whole URL (rare), use URI mode. For encoding a single query parameter value (the common case), use component mode.
What happens if the input is already encoded?
If you encode it again, you get double-encoding (e.g., %20 becomes %2520). If you decode an already-decoded string, you get the same string back. The tool warns when it detects a double-encoded pattern in the input.
How do I encode a URL for use in a JSON value or HTML attribute?
Use URL encoding first (this tool), then JSON-escape or HTML-escape the result if the context requires it. URL encoding alone doesn't make a value safe inside JSON strings or HTML attributes — see our HTML Escape tool for the next layer.
Is my text sent to a server?
No. Encoding and decoding happen entirely in your browser using built-in JavaScript URL APIs. Your text never leaves your device — no upload, no logging.
Does it support international (Unicode) characters?
Yes. Unicode characters are encoded as their UTF-8 byte sequence, each byte as %XX. For example, the character é becomes %C3%A9. Decoding reverses this back to the original character.
Related tools
03URL Parser & Query String Decoder→
Break any URL into protocol, host, path, query, and hash — UTM-labeled, double-encoding flagged, JSON output.
Query String Builder→
Compose URL query strings from key-value rows — repeated keys for arrays, automatic percent-encoding, live preview.
UTM Builder→
Build campaign URLs with source, medium, campaign, term, and content fields.