Encode text or files to Base64 and decode Base64 back to text or a downloadable file. Supports UTF-8, URL-safe Base64 and data URIs.
URL Encoder and Decoder
Encode text for safe use in URLs or decode percent-encoded strings, with component, full URL and form (+ for space) modes.
Text to encode
0 characters · 0 B as UTF-8
Encoding
Like encodeURIComponent: everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ) is encoded. Use it for one value: a query parameter, a form field or a path segment.
Leaves only A–Z a–z 0–9 - . _ ~ unencoded, as OAuth 1.0 signatures and AWS Signature Version 4 query strings require.
Keeps line breaks, so a list of values stays one per line instead of being joined with %0A.
Form data and most query strings write spaces as +. Leave it off for paths, where + is a plus sign.
For text that was encoded twice, such as %2520. Decodes until nothing is left (at most 10 times).
Instead of stopping at the first broken % sequence, keeps it unchanged and tells you where it is.
Encoded
Runs entirely in your browser. Your files and text are not uploaded.
How to use URL Encoder and Decoder
-
Step 1: Choose Encode or Decode
For encoding, also pick Component, Full URL, Form or Non-ASCII only. The note under the choice explains what each one keeps.
-
Step 2: Paste your text
The result updates as you type. Errors name the position of the broken sequence, and “Show it in the input” selects it.
-
Step 3: Copy or download
Copy the result, save it as a .txt file, or press Swap to reverse the conversion.
How percent-encoding works
A URL may contain only a limited set of ASCII characters. Any other character, and any character that has a special meaning where it appears, is written as a % sign followed by two hexadecimal digits for each byte (RFC 3986, section 2.1). Characters outside ASCII are first turned into UTF-8 bytes: ₹ (U+20B9) is the three bytes E2 82 B9, so it becomes %E2%82%B9. The tool writes upper-case hex digits, as RFC 3986 recommends.
Which mode to use
- Component works like JavaScript's
encodeURIComponent. It leaves A–Z a–z 0–9 - _ . ! ~ * ' ( ) as they are and encodes everything else. Use it for one value: a query parameter, a form field or a path segment. - Full URL works like
encodeURI. It also leaves ; , / ? : @ & = + $ # alone, so a complete address that contains spaces or non-English text keeps its structure. - Form writes data the way
URLSearchParamsdoes, in the application/x-www-form-urlencoded format that HTML forms also send. It leaves A–Z a–z 0–9 * - . _ alone and turns a space into +. - Non-ASCII only leaves every ASCII character alone, including spaces and existing %XX sequences, and encodes the rest. Use it for an address that is otherwise ready but contains Hindi or other non-English letters, or one that is already partly encoded.
The difference between Component and Full URL matters. Full URL keeps & = ? / and # because they separate the parts of an address. Used on a single value such as Tom & Jerry, it leaves the & in place (Tom%20&%20Jerry), and the value is split in two. Component encodes it as %26 (Tom%20%26%20Jerry), which is why it is the right choice for values.
The strict option also encodes ! ' ( ) *, leaving only the unreserved characters of RFC 3986, section 2.3 (A–Z a–z 0–9 - . _ ~). OAuth 1.0 signatures and AWS Signature Version 4 query strings expect this form.
Worked example
The value नई दिल्ली & co in Component mode becomes:
%E0%A4%A8%E0%A4%88%20%E0%A4%A6%E0%A4%BF%E0%A4%B2%E0%A5%8D%E0%A4%B2%E0%A5%80%20%26%20co
Each Devanagari letter or sign takes three UTF-8 bytes, so it turns into three %XX groups. In Form mode the three spaces become + instead of %20.
Decoding
Decoding reads each %XX as a byte and the bytes as UTF-8 text. When a % is not followed by two hex digits, or the bytes are not valid UTF-8, the tool stops and names the position. A common cause is %E9 on its own: older systems wrote é that way in Latin-1, while UTF-8 uses %C3%A9. Switch on Leave malformed sequences as they are to decode everything else.
A + is turned into a space only when you ask for it, because in a path + is a real plus sign. Decode repeatedly handles text that was encoded twice, such as %2520: %25 is the % sign, so the first round gives %20 and the second a space. Decoded control characters such as %00 (null) are kept, and the page points them out, because the output box shows them as a blank or a box.
Everything runs in your browser. The text you paste is not uploaded.
Limitations
- Decoding assumes UTF-8. Links made with Latin-1, Windows-1252 or other older encodings usually show an error (or stay unchanged in tolerant mode), and occasionally decode to the wrong letters.
- The tool does not know which parts of your text are already encoded. Component, Full URL and Form turn an existing %20 into %2520. For a partly encoded URL, use Non-ASCII only, which keeps existing %XX sequences. Decoding the whole URL and encoding it again can change its meaning, because an encoded & or = becomes a real separator.
- It does not convert domain names. A name such as उदाहरण.भारत is written in Punycode (xn--…) in real addresses, as RFC 3986 recommends; this tool percent-encodes it instead.
- It does not check whether a link works, where it leads or whether it is safe.
- Text with a broken emoji (half of a surrogate pair) has no UTF-8 form and is rejected with its position.
- Browsers store line breaks in a text box as LF, so a Windows line break (CRLF) is encoded as %0A, not %0D%0A.
- Up to 10 MB of text, measured as UTF-8: 1,04,85,760 English letters, or a third as many Hindi characters, which take 3 bytes each. Very long results are shortened in the output box; Copy and Download always use the full result.
- Browsers are slow to lay out very long text in scripts such as Hindi or Tamil inside a text box. Pasting a few hundred thousand such characters can make the page pause for several seconds before anything else happens. Plain English text of the same length is much quicker.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI (Full URL mode) keeps the characters that structure an address, such as / ? & = and #, so the result still works as a complete URL. encodeURIComponent (Component mode) encodes those too, because inside a single value an & or = would be read as the start of another parameter. Use Component for values and Full URL only for whole addresses.
Should a space be encoded as %20 or +?
Both appear in real URLs. %20 is correct everywhere. + means a space only in form data and query strings in the application/x-www-form-urlencoded format; in a path it is a plus sign. Choose Form mode to get +, and switch on “Decode + as a space” when decoding form data.
Why do I get a “Malformed UTF-8” error?
The %XX bytes do not form valid UTF-8 text. Often a character was encoded with an old single-byte character set, for example é as %E9 instead of %C3%A9, or the text was cut in the middle of a character. The message shows the position; switch on “Leave malformed sequences as they are” to decode the rest.
How do I fix a URL that shows %2520 or %253A?
The text was encoded twice: %25 is the encoded % sign, so %2520 is an encoded %20. Decode it once to get the correctly encoded URL back (%2520 becomes %20 and %253A becomes %3A). To see the plain text instead, switch on “Decode repeatedly”, which decodes until no encoded sequences are left (at most 10 times).
Why are ! ' ( ) and * not encoded?
encodeURIComponent follows the older URL standard, RFC 2396, which listed them as unreserved. RFC 3986 made them reserved, and some systems, such as OAuth 1.0 signatures and AWS Signature Version 4, require them encoded. Switch on “Also encode ! ' ( ) *” in Component mode for that strict form.
Is my text sent to a server?
No. Encoding and decoding happen with JavaScript in your browser. Nothing you paste is uploaded or stored.
Related tools
Format, minify and validate JSON in your browser. Errors are shown with the exact line and column, and numbers are kept exactly as written.
Convert a JSON array into a CSV file for Excel or Google Sheets. Nested objects become columns, and formula protection is on by default.
Convert CSV or TSV to JSON objects or arrays. Detects the delimiter, keeps leading zeros in phone numbers and PIN codes, and lists problem rows.