What is URL Encoder / Decoder?
A URL encoder and decoder converts text to and from percent-encoding, the format URLs use to carry characters that would otherwise be unsafe or ambiguous. Encoding replaces spaces, punctuation, and non-ASCII characters with a % followed by the character's byte value in hexadecimal - so a space becomes %20 and an ampersand becomes %26 - while decoding reverses the process to recover the original text. This tool gives you both directions plus the choice that trips up most developers: encodeURIComponent, which escapes the reserved delimiters (& = ? / #) so a single value is safe inside a query string, versus encodeURI, which leaves those delimiters intact so a whole URL keeps its structure. Everything runs in your browser using the same standard functions your JavaScript uses, so the output matches what your code will produce.
Encode text and URLs to percent-encoding or decode encoded URLs back to plain text. Switch between encodeURIComponent and encodeURI, right in your browser.
Try it now
Open the free URL Encoder / Decoder and follow the steps below - no download required.
Why use URL Encoder / Decoder?
- Encode any value for safe use in a query string, path, or form submission
- Decode percent-encoded URLs and query strings back into readable text
- Switch between encodeURIComponent (single value) and encodeURI (full URL) in one click
- Get a clear, friendly error when decoding malformed input instead of a cryptic crash
- Runs 100% in your browser - links and tokens are never uploaded or logged
How to use URL Encoder / Decoder - step by step
- Step 1: Choose Encode or Decode with the buttons at the top.
- Step 2: When encoding, pick "Encode component (encodeURIComponent)" for a single value, or "Encode full URL (encodeURI)" for a complete link.
- Step 3: Paste your text or URL into the input box.
- Step 4: Press Encode or Decode and copy the result from the output box.
The URL Encoder / Decoder lives under Developer Tools. Open the tool page, enter your input in the main field, and results update instantly. Use the copy button to paste output into documents, code editors, or spreadsheets.
Common use cases
Building query strings
Encode each parameter value with encodeURIComponent before joining it with & and = so a value containing a space, &, or = never breaks the query - for example turning `shoes & socks` into `shoes%20%26%20socks`.
Debugging APIs and webhooks
Paste an encoded URL from a log, redirect, or OAuth callback and decode it to read the real parameters, redirect_uri, or tokens being passed around.
Encoding non-ASCII text
Turn accented letters, emoji, or other Unicode into UTF-8 percent-escapes so they survive being placed in a URL, then decode them back to verify the round-trip.
Sharing links with parameters
Encode search terms, UTM tags, or filter values you are appending to a link so the final URL stays valid when it is clicked, pasted, or embedded.
Examples
- Encode a query value: hello world & more becomes hello%20world%20%26%20more
- Encode a full URL: https://example.com/a b?q=1 becomes https://example.com/a%20b?q=1 with encodeURI
- Decode an encoded URL: https%3A%2F%2Fexample.com%2Fsearch decodes to https://example.com/search
Pro tips
- Use encodeURIComponent for the parts of a URL (individual values and path segments) and encodeURI only for a complete URL you do not want to break apart.
- encodeURIComponent does not escape ! ' ( ) *; if a strict parser needs those encoded too, replace them manually after encoding.
- A plus sign (+) in a query string can mean a space in form-encoded data - decode carefully and confirm whether the source used %20 or + for spaces.
- Never double-encode: encoding an already-encoded string turns every % into %25, which is a common cause of broken links.
- If decoding throws an error, look for a lone % or an invalid sequence like %zz - every % must be followed by two hex digits.
Frequently asked questions
What is URL encoding (percent-encoding)?
URL encoding, also called percent-encoding, replaces characters that are unsafe or reserved in a URL with a % followed by two hexadecimal digits representing the byte value. For example a space becomes %20 and an ampersand becomes %26. It lets you safely include spaces, symbols, and non-ASCII characters in a URL, query string, or form submission.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent escapes almost every reserved character - including & = ? / # : @ + and space - so it is the right choice for a single query-string value or path segment. encodeURI leaves the characters that make up a URL's structure (: / ? & = #) untouched, so it is meant for encoding a complete URL that already contains those delimiters. As a rule: use encodeURIComponent for the parts, encodeURI for the whole.
Which characters get encoded?
Unreserved characters (A-Z, a-z, 0-9, and - _ . ! ~ * ' ( )) are never encoded. Reserved and unsafe characters - spaces, &, =, ?, /, #, %, and any non-ASCII character such as accented letters or emoji - are converted to one or more %XX bytes (UTF-8). encodeURIComponent encodes the reserved delimiters too, while encodeURI preserves them.
How do I build a query string safely?
Encode each value with encodeURIComponent before joining them with & and =. For example, `?q=` + encodeURIComponent('shoes & socks') produces `?q=shoes%20%26%20socks`. This prevents a value that contains &, =, or a space from being mistaken for a delimiter and breaking your query string.
Why do I get an error when decoding?
Decoding fails when the input contains a malformed percent-escape - a lone "%" not followed by two hex digits, or an invalid sequence like "%zz". Check that every "%" is followed by a valid two-digit hex code. Text that was never URL-encoded will pass through unchanged unless it contains a stray "%".
Is my data sent to a server?
No. All encoding and decoding happens entirely in your browser using the standard encodeURIComponent, encodeURI, and decodeURIComponent functions. Nothing you paste is uploaded, logged, or stored.
Related tools you might need
Explore other developer tools on ToolsMinify. Related utilities are linked on the URL Encoder / Decoder page to help you complete your workflow without leaving the site.
Ready to start?
Use the URL Encoder / Decoder for free - accurate, fast, and optimized for mobile.