Encode or decode text with %XX sequences, either as a URL component or as a full URL whose separators stay intact.
What is URL Encode/Decode?
URL Encode/Decode is a free online tool that percent-encodes text, or decodes %XX sequences back to text, in your browser. The “Component” scope treats the text as one piece of a URL, such as a query value, and the “Full URL” scope treats it as a whole address and leaves its separators alone.
It follows the rules of the JavaScript functions encodeURIComponent and encodeURI, with their decoding counterparts, always in UTF-8, and it refuses a malformed % sequence with its position instead of guessing.
What it supports
- Encoding with the “Component” scope works like encodeURIComponent: every character is encoded except letters, digits and - _ . ! ~ * ' ( ).
- With the “Full URL” scope it works like encodeURI, so it also leaves ; , / ? : @ & = + $ # as they are.
- Both scopes write non-ASCII text as UTF-8 bytes with uppercase hexadecimal digits (é becomes %C3%A9), and a space becomes %20, never +.
- Decoding with the “Component” scope decodes every %XX sequence, like decodeURIComponent. With the “Full URL” scope, sequences that stand for ; , / ? : @ & = + $ # stay encoded, like decodeURI.
- Text that is not percent-encoded is left as it is when decoding, and a + stays a +. The decoded bytes must form valid UTF-8 text.
- Text with an unpaired surrogate (half of an emoji) cannot be percent-encoded, so encoding it is refused, with its line and column.
Good to know
- A + is never turned into a space. HTML forms and many query strings write a space as +, so if your text comes from one, replace the + signs with spaces yourself before you decode.
- Encoding text that is already encoded encodes the % signs again: %20 becomes %2520. Decode first if you are not sure what you have.
- The “Component” scope is for one piece of a URL, such as a query value or a path segment, and “Full URL” is for a whole address. Encoding a whole address with “Component” encodes its : and / too, which breaks it.
- A % that is not followed by two hexadecimal digits is refused with its position, and so are percent-encoded bytes that are not valid UTF-8 text, such as the Latin-1 %E9. Nothing is repaired.
- The tool works on text only: it does not check that the result is a valid URL, does not split it into parts and never fetches anything.
How do I use URL Encode/Decode?
- Paste or type your text, or your percent-encoded text, in the input box. Nothing runs while you type.
- Under “Mode”, choose “Encode” or “Decode”, and under “Scope”, choose “Component” or “Full URL”. Then press “Convert”.
- Read the result next to your input. If a % sequence is malformed or the bytes are not valid text, the message says why and gives the line and column.
- Press “Copy” to put the result on your clipboard, or “Download” to save it as converted.txt.
Examples
Encode a query value
Leave “Mode” on “Encode” and “Scope” on “Component”, paste this text and press “Convert”. Every character that could be read as a separator is encoded: the space becomes %20, & becomes %26, / becomes %2F, ? becomes %3F and = becomes %3D, and “ã” becomes its two UTF-8 bytes, %C3%A3.
São Paulo & Rio/RJ?x=1S%C3%A3o%20Paulo%20%26%20Rio%2FRJ%3Fx%3D1A stray percent sign
Choose “Decode” and press “Convert”. The % in “100% sure” is not followed by two hexadecimal digits, so the text cannot be decoded and the message gives the position of the sign. To write a literal percent sign, use %25.
100% sureA percent sign (%) must be followed by two hexadecimal digits, such as %20. This one is not, so the text cannot be decoded. Write a literal percent sign as %25.
Line 1, column 4
Encode a full address
Choose “Full URL”. The characters : / ? & and = stay as they are, while the spaces and the “é” are encoded, so the address keeps its structure.
https://example.com/path with space/café?q=a b&lang=pt-BRhttps://example.com/path%20with%20space/caf%C3%A9?q=a%20b&lang=pt-BRA plus sign stays a plus sign
Choose “Decode”. The + is kept as a +, which differs from decoding an HTML form or a query string, where + means a space. Only %20 becomes a space, and %2B becomes a +.
a+b%2Bc%20da+b+c dDecode a full address
With “Full URL”, a sequence that stands for a separator (%2F, %3F, %26, %3D, %23 and the other reserved characters) stays encoded, so the structure of the address does not change. The space and the “é” are decoded.
https://example.com/a%20b%2Fc?q=caf%C3%A9%26xhttps://example.com/a b%2Fc?q=café%26xBytes that are not UTF-8
Choose “Decode”. %E9 is “é” in the old Latin-1 encoding, but in UTF-8 it is not a complete character, so the tool refuses and gives the position of those bytes instead of showing a wrong character.
caf%E9These percent-encoded bytes are not valid UTF-8, so they do not make up any text. The text may be damaged or may use another character encoding.
Line 1, column 4
Limits and privacy
Size limits
- Input: up to 2,000,000 bytes of UTF-8 text (about 2 MB). Accented letters and emoji take more than one byte each. Larger input is rejected.
- Result: also up to 2,000,000 bytes. If the complete result would be larger, the tool shows only an incomplete preview of the first 100,000 bytes, and that preview cannot be copied or downloaded.
- Time: a run that takes longer than its time limit is stopped. Try a smaller input.
Is my text sent to a server?
No. The text you type or paste, or open from a local file, is processed locally in your browser, in a dedicated Web Worker. It is never uploaded or sent to the server (a file you open is read in your browser only), and it is not written to storage, cookies or the address bar.
“Copy” puts the result on your clipboard and “Download” saves it as a file, but only when you press the button. The file is created in your browser, so nothing is uploaded.
For the full details, see the Privacy Policy
Related tools and pages
Your text stays in the page when you switch tools in the same tab, so you can try the same text in another tool. Reloading or closing the tab ends it.