URL Encoder / Decoder
Encode or decode URLs, query strings, and parameters — instantly, in your browser.
Encode or Decode URLs Instantly
This free online tool converts text to and from percent-encoding (URL encoding) — the format used for query parameters, form data, and special characters inside a URL. Type or paste your text, pick Encode or Decode, and get the result immediately as you type.
How It Works
- Choose Encode or Decode using the toggle above.
- Type or paste your text — conversion happens instantly, no button required.
- Full URL vs. component encoding: leave the checkbox off to encode every reserved character (safe for a single query parameter value), or check it to preserve URL structure characters like
/,?, and&(for encoding an entire URL). - Swap flips the input/output and toggles the mode, so you can immediately verify a round-trip.
- Copy the result to your clipboard with one click.
Component Encoding vs. Full URL Encoding
Component encoding (JavaScript's encodeURIComponent) escapes every character that isn't
safe in a single query string value, including /, ?, &,
and = — use this when encoding a value you're about to insert into a URL. Full URL
encoding (encodeURI) leaves those structural characters alone, since encoding them
would break the URL itself — use this when encoding an already-complete URL that just has spaces
or other unsafe characters in it.
For binary-safe encoding of the value itself rather than its URL characters, see the Base64 Encoder / Decoder.
The difference is clearest on a whole URL. The same input, https://example.com/search?q=hello world&tags=json,tools#section 1,
gives two very different results:
| Mode | Output |
|---|---|
| component (box off) | https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26tags%3Djson%2Ctools%23section%201 |
| full URL (box on) | https://example.com/search?q=hello%20world&tags=json,tools#section%201 |
The component result cannot be used as a link any more (the :// is gone), but it is exactly what you want when the whole
URL is itself a value, for example in a redirect= parameter. The full-URL result is still a working link, now with
the two spaces written as %20.
Exactly Which Characters Are Left Alone
We ran every printable ASCII character through the live tool in both modes. Letters and digits are never touched. Beyond those:
| Group | Characters |
|---|---|
| Left alone in component mode (besides letters and digits) | !'()*-._~ |
| Left alone in full-URL mode (besides letters and digits) | !#$&'()*+,-./:;=?@_~ |
| Escaped in both modes | space and "%<>[\]^`{|} |
| Escaped only in component mode | #$&+,/:;=?@ |
Two details surprise people. First, component encoding leaves ! ' ( ) * unescaped. Those five are
reserved characters in RFC 3986, but JavaScript's encodeURIComponent does not escape them, and neither does this tool. If a strict
server needs them as %21 %27 %28 %29 %2A, replace them yourself afterwards. Second, full-URL mode still escapes square brackets, so
a[0]=1&b[]=2 becomes a%5B0%5D=1&b%5B%5D=2 even there. This matters for query strings that use brackets for arrays: many servers accept the escaped
form, but check yours.
Space: %20 or +?
The encoder always writes a space as %20, which is valid everywhere in a URL. The plus sign as a space comes from the older
application/x-www-form-urlencoded format used by HTML forms in query strings and request bodies, and it is only meaningful there.
The decoder understands both: it turns every + into a space first and then decodes the %XX sequences. The input
a+b%2Bc%20d therefore decodes to a b+c d: the first plus was a space, the %2B was a real plus, and
%20 was a space. Because the tool always does this, decoding the path of a URL, where a plus is just a plus, will turn
those plus signs into spaces. In that case replace + with %2B before decoding.
Query Values, Path Segments and Whole URLs
Use component encoding (checkbox off) for any single piece you insert into a URL: a query value, a path segment, a fragment. The text
a&b=c d+e/f contains four characters that would change the meaning of a query string. Encoded as a value it becomes a%26b%3Dc%20d%2Be%2Ff, so
?q= followed by that text is read as one value. A file name such as my file (v2).pdf in a path becomes my%20file%20(v2).pdf: the space
is escaped and the parentheses are left alone, which is valid. Use full-URL mode only when you hold a complete URL and just need to clean up spaces
and other unsafe characters without breaking its structure. Never encode a complete URL with component encoding and then use it as a link.
Double Encoding and How to Spot It
Double encoding happens when already-encoded text is encoded again. The percent sign itself is escaped as %25, so
100% sure encodes to 100%25%20sure, and encoding that result again gives 100%2525%20sure. The telltale sign is %25 followed by two hex digits,
such as %2520 where you expected %20. Decoding peels off one layer at a time: caf%25C3%25A9 decodes to
caf%C3%A9, which still contains encoded bytes, and decoding that a second time gives café. Decode repeatedly with Swap until the text stops changing, and fix the code that
encodes twice (often a framework that encodes parameters you already encoded by hand).
Non-ASCII Text Becomes UTF-8 Bytes
Characters outside ASCII are first converted to UTF-8 bytes, and each byte is written as % plus two hex digits. In the
live tool, café ☕ 日本 encodes to caf%C3%A9%20%E2%98%95%20%E6%97%A5%E6%9C%AC: é is two bytes (%C3%A9), the coffee cup three
(%E2%98%95), and each Japanese character three. An emoji such as the waving hand needs four bytes and gives %F0%9F%91%8B.
Decoding reverses this, which is why a broken byte sequence is an error: %C3%28 is not valid UTF-8, so the tool reports
URI malformed.
When Decoding Fails
Decoding stops with Invalid percent-encoding — could not decode: URI malformed in three cases: a lone % (as in 100%), a
% followed by fewer than two hex digits (%E0%A4%A), or bytes that do not form valid UTF-8 (%C3%28). Real-world
causes are text that was never encoded (a literal percent sign), a value that was cut off in the middle of a sequence, or text that was encoded with a
legacy character set such as Latin-1 (%E9 for é), which is not valid UTF-8. The output box is cleared when an error appears, so an error is never shown next to an old result.
Privacy
All encoding and decoding happens entirely in your browser using JavaScript. Nothing you type is ever sent to a server.
URL Encoding — Options Explained
URL/percent-encoding has a few subtleties that trip people up. Here's what each option on this page actually does.
What Gets Encoded
Anything other than letters, digits and - _ . ! ~ * ' ( ) is replaced with a %XX sequence representing its UTF-8 byte value in component mode — spaces become %20, for example. Non-ASCII characters become several %XX groups.
Component vs. Full URL
Component encoding (default) also escapes / ? # @ $ & + , : ; =, since those are only safe as structural URL characters, not inside a single value. Enable "full URL" mode to leave them untouched. Square brackets are escaped in both modes.
Decoding Handles + as Space
Some legacy form encodings use + for spaces instead of %20. Decode mode converts + to a space before percent-decoding, matching how browsers handle application/x-www-form-urlencoded data.
Invalid Input Handling
If the decoded text contains a malformed % sequence (not followed by two valid hex digits) or bytes that are not valid UTF-8, the tool shows an inline error instead of crashing or silently producing garbage output.
Who Uses This Tool?
API Developers
Encode query parameter values before building request URLs by hand, or decode a captured request to see what was actually sent.
Web Developers
Debug redirect URLs, deep links, and share URLs that carry encoded parameters — decode them to read the real values.
QA & Support Teams
Quickly decode a URL pasted from a bug report or support ticket to understand exactly what a user's browser sent.
Students & Learners
See exactly which characters get encoded and why, while learning how URLs and query strings are structured.
Frequently Asked Questions
What is URL encoding?
URL encoding (percent-encoding) replaces characters that aren't safe inside a URL with a % followed by two hexadecimal digits representing the character's byte value, so text with spaces or symbols can be safely included in a URL.
Should I use component or full URL encoding?
Use component encoding (default, checkbox off) when encoding a single value that will go inside a URL, like a query parameter. Use full URL encoding (checkbox on) when you already have a complete URL and just need to escape unsafe characters like spaces without breaking its structure.
Why did decoding fail with an error?
Decoding fails when the input contains a malformed % sequence — for example, a % not followed by two valid hex digits — or bytes that are not valid UTF-8. This usually means the input wasn't fully URL-encoded, was cut off, or was encoded with a legacy character set.
Does this handle Unicode characters?
Yes. Non-ASCII characters are encoded as their UTF-8 byte sequences (each byte as a %XX triplet), matching how browsers and encodeURIComponent handle Unicode text.
Is my data uploaded anywhere?
No. All encoding and decoding happens locally in your browser with JavaScript. Nothing is sent to a server.
Should a space be %20 or +?
The encoder always writes %20, which is valid in every part of a URL. A plus sign means a space only in form-encoded data (application/x-www-form-urlencoded). The decoder turns every plus into a space, so a+b decodes to a b; write %2B when you need a real plus.
What is double encoding and how do I spot it?
Double encoding means text was percent-encoded twice, so the percent sign itself became %25. Look for %25 followed by two hex digits, such as %2520 for a space. Decode once, check whether the result still contains %XX sequences, and decode again until it stops changing.
Which characters does the tool leave unencoded?
Letters and digits always. Component mode also leaves - _ . ! ~ * ' ( ). Full-URL mode additionally leaves # $ & + , / : ; = ? @. Spaces, quotes, %, < >, square brackets, backslash, caret, backtick, braces and the vertical bar are escaped in both modes.
Related Tools
- Base64 encoder and decoder: encode or decode Base64 with UTF-8 and URL-safe support.
- JSON escape and unescape tool: escape or unescape a JSON string.
- cURL to code converter: turn a request with an encoded URL into code.
- JWT decoder: read a token's header, payload and expiry.
- UUID generator: create identifiers to use as path segments or query values.
- Compare two JSON documents: compare two captured request or response bodies after decoding.
- JSON formatter and fixer: validate, format and repair JSON before you use it here.
- All JSON tools: every free tool listed on one page.
Built by Deepak Kumar — a developer who wanted a JSON tool that respects your privacy. All processing happens in your browser. Your data never leaves your device.