URL Encoder & Decoder

Global tools

Percent-encoding lets URLs carry characters that would otherwise be read as structure - a space, an & that starts another parameter, a # that starts a fragment. This page encodes plain text into that form and decodes escaped text back, with automatic mode that recognizes which way it should go and says so.

Automatic mode encodes plain text and decodes a string that already contains % escapes, and says which way it went.

The difference between encodeURI and encodeURIComponent, in one setting - and the reason a + in a link sometimes turns into a space.

Paste a whole URL, one query value, or a string that already contains percent escapes.

Leave it blank for "encoded.txt".

Results update as you type. Nothing leaves your device.

Text encoded for a URL

18 extra characters

Encoded as a value inside a query string. 18 characters were added to escape what the URL parser would otherwise read as structure.

Input
46 characters
Output
64 characters

Encoded URL

https%3A%2F%2Fdanfio.app%2Ftools%3Fq%3Dhello%20world%26lang%3Den

Copy it, or download it as a file. This is what to put in a link, an iframe src, or a <form> field value.

What the numbers do not say

  • Percent-encoding has three common flavors and they disagree about the space: %20 in a query value, + in form data, %20 in a path. The scope above is the one that was applied, so the output is shaped for exactly one context.
  • Encode once. Encode a URL you already escaped and the % itself gets escaped, because percent is a character like any other - the %26 dance in query strings is this happening by accident.
  • Encoding is not encryption: it exists so URLs can carry characters that would otherwise break their structure, and it hides nothing.
The a value inside a query string was escaped in this browser tab: nothing was uploaded, and nothing is stored.

The reason the page has a scope setting instead of one button is that percent-encoding is three different dialects. A query value escapes the & delimiter, a whole URL leaves the real &s alone, and form data turns a space into a +. The page names which dialect it applied, because most "why did my URL break" questions are a scope mismatch in disguise.

About this url encoder & decoder

Paste a URL with an ampersand inside a parameter, or a search term with a space, and this page shows what percent-encoding should do to it. Encode plain text or decode escaped text, with an automatic mode that recognizes the direction and states which of the three dialects it applied.

The three dialects are the whole point: a query value escapes the `&` that would end it, a whole URL leaves the real `&` and `/` alone, and form data turns a space into a plus. The page names the scope it used, because most questions about a broken URL are a scope mismatch in disguise. It runs client-side, so a signed link is never sent anywhere.

Double-encoding is the failure this page is built to make visible: encode an already-encoded string and `%20` becomes `%2520`, which the server then reads literally. The page shows input and output side by side rather than applying a mystery second pass. For anyone debugging a callback URL, that side-by-side is the whole value.

How this url encoder & decoder works

The three dialects and the space

Inside a query value, encodeURIComponent-style encoding escapes &, =, / and everything else that could be misread, and a space becomes %20. On a whole URL, only what must be escaped is - the &, / and : that separate the URL are left alone or it stops working. In form data, a space becomes + and everything else follows the component rules.

Decoding reverses whichever dialect you say the text came from, which matters most for the +: a + decoded as component data stays a +, and a + decoded as form data becomes a space. The page’s default for form data turns the pluses back into spaces, because that is what form encoding did to them.

Encode once, the way double-encoding happens

Percent is itself a character the encoders know about, so encoding a URL that is already escaped will escape its % signs and turn %20 into %2520. That is not a bug in the page; it is the exact mechanism behind the %26 dance in query strings, and the page says so - encode once, and decode as many times as the string was encoded.

The classic culprit is a callback address: a framework percent-encodes its parameter once, the link builder does it again, and the server only unescapes one layer - leaving a literal %252F or %26 for the reader to trip over. Watching the input and output side by side shows how many layers piled up, which tells you how many times to decode rather than guessing.

Encoding is not encryption

Nothing here hides anything. Percent-encoding exists so URLs can carry characters, and the decoded form is one step away. The page makes that explicit because people paste encoded strings into it expecting privacy - and a %-escaped string is about as private as base64, which is to say not at all.

The person who receives the string needs no key: any decoder, this one included, reverses it in one step. So a token or password sitting inside an encoded URL is readable, and trusting this transformation with something secret is the same mistake as trusting base64 with it.

Non-ASCII text becomes UTF-8 bytes first

A non-ASCII character has no single percent sequence of its own: the page encodes its UTF-8 bytes, and each byte becomes one %XX escape. The accented e in "caf\u00e9" turns into caf%C3%A9, and a CJK character into three escapes. That is the same thing a browser does when it navigates to a URL containing those bytes - punycode, the other way domains are made URL-safe, is a separate scheme this page does not touch.

Because each character becomes the escapes of its own UTF-8 bytes, the same idea can look different under another encoding. This page works consistently in UTF-8, matching what a browser puts in the address bar, so a browser-escaped URL pasted in here decodes back to the same text rather than to mojibake.

What encoding does not fix downstream

A percent-encoded string is safe inside a URL and nowhere else. Drop it into an HTML attribute and the & that separates query parameters still has to be written as &amp; in the markup; put it in a JSON body and the % signs are ordinary characters. Encoding answers "will the URL parser read this as structure", not "is this safe in every context".

Servers decode too, and some decode twice. A value that arrives with %20 already turned back into a space was decoded once before you saw it; one that arrives as %2520 was encoded again on the way out. Both are scope-and-layer problems, which is exactly what the scope setting on this page exists to make visible.

Practical URL ceilings are another limit the page cannot enforce. Browsers cope with very long URLs, but proxies, mail clients and server configs often cut around 2,000 characters. If an encoded payload approaches that, the link should carry an id and the data should live behind it.

Worked examples

Each example below was run through the calculator on this page when the site was built, so the numbers match what you see when you enter the same inputs.

A search query with a space

What to do: Encode to percent-encoding · Percent-encoding style: A value inside a query string (%26, %3D, %2F escaped) · Input: hello world · Download file name: —

Encoded for a URL

2 extra characters

Encoded as a value inside a query string. 2 characters were added to escape what the URL parser would otherwise read as structure.

Input: 11 characters · Output: 13 characters

Component encoding turns the space into %20: "hello%20world" - exactly what a query value expects.

The same text as form data

What to do: Encode to percent-encoding · Percent-encoding style: Form data, where a space becomes + · Input: hello world · Download file name: —

Encoded for a URL

nothing to escape

Encoded as form data. Every character was already URL-safe, so the output equals the input - a useful property to know about by checking, not by assuming.

Input: 11 characters · Output: 11 characters

Form encoding turns the space into + instead: "hello+world", the dialect form submissions actually send.

Decoding a whole URL

What to do: Decode percent-encoding to plain text · Percent-encoding style: A whole URL (& and / and : left alone) · Input: https://danfio.app/tools?q=hello%20world · Download file name: —

Decoded to plain text

plain text

Decoded as a whole URL.

Input: 40 characters · Output: 38 characters (38 B)

Whole-URL decoding leaves the url’s own &s and slashes alone and turns %20 back into the space in the query value.

Non-ASCII text, encoded as bytes

What to do: Encode to percent-encoding · Percent-encoding style: A value inside a query string (%26, %3D, %2F escaped) · Input: café · Download file name: —

Encoded for a URL

5 extra characters

Encoded as a value inside a query string. 5 characters were added to escape what the URL parser would otherwise read as structure.

Input: 4 characters · Output: 9 characters

The accented e is not one byte, so it becomes the two escapes C3 A9: "caf%C3%A9" is the UTF-8 of the word percent-encoded, exactly what a browser puts in the address bar.

Frequently asked questions

What is the difference between %20 and + in a URL?

%20 is the percent-encoded space used in URLs and query values; + is the space in form-encoded data. They are two dialects of the same fact, which is why a + that becomes a space - or a %20 that survives as %20 - is the classic scope-mismatch symptom.

Why does my decoded URL still have %20 in it?

Almost always because it was encoded twice: the first pass turned the space into %20, and the second turned the % into %25, leaving %2520. Decode once more and it comes out clean.

Does percent-encoding hide my data?

No. Encoding is for carrying structure through a URL, not protection: any decoder, this page included, reverses it in one step with no key. A token or password in an encoded URL is about as exposed as one in base64 - which is to say readable - so it should not be treated as private.

How do non-ASCII characters work in an encoded URL?

A non-ASCII character is encoded as the percent-escapes of its UTF-8 bytes: the accented e in "caf\u00e9" becomes %C3%A9, not a single escape. That matches what a browser produces, so a browser-escaped URL pasted here decodes back to the same text. Punycode - the xn-- form used for non-ASCII domains - is a different scheme and not part of percent-encoding.

Should I pre-encode a URL before putting it in a link?

No - encode it once, in the whole-URL scope for a full link or the component scope for a single value. Encoding an already-escaped URL escapes the percent signs themselves (the %26 dance), which is nearly always the bug behind a link that looks doubled. Let the page encode exactly once, the way the target context expects.

Assumptions and sources

  • Percent-encoding follows RFC 3986: `%XX` escapes, and the reserved characters each scope leaves alone because they carry structure.
  • Three scopes are offered because URLs have three jobs: a value inside a query string, a whole URL, and form data where a space becomes `+`.
  • Encoding happens in your browser and nothing is uploaded.

Last reviewed 2026-09-26. Runs locally on your device; keep backups; no financial advice applies. Read the full disclaimer.

Where a figure on this page comes from an official agency — HUD, IRS, FICO or a state body — the site keeps a dated snapshot of the source page in its sources library, and a scheduled job re-checks that snapshot, so the number can be traced back to the document it came from.