URL encoder and decoder
Percent-encode text for a URL or read it back, with the three schemes that actually differ and a list handled line by line.
Drop your files here
.txt · up to 5 MB
How to encode and decode a URL
- 1
Paste your text or a list of URLs
One value or fifty, one per line. A .txt file works too, and UTF-8 or Windows-1251 are both read.
- 2
Pick encode or decode and a scheme
Component for a single value, full URI for a whole address, form-urlencoded for a POST body.
- 3
Copy the result
Copy it straight out or download it as a text file, with the line structure preserved either way.
Three schemes, and why picking wrong breaks links
Component encoding escapes everything that is not unreserved, including : / ? # & =. That is correct for a single value going into a query string, and wrong for a whole address: encode https://example.com/a?b=1 as a component and every structural character becomes a percent sequence, leaving a string that is no longer a URL. Full-URI encoding leaves those structural characters alone and escapes only spaces and non-ASCII, which is what you want when the input is already a complete address. Form-urlencoded is component encoding plus one substitution: spaces become plus signs, as required by the format HTML forms post in.
The plus sign is genuinely ambiguous
In a form-urlencoded body, + means a space. In a path segment, + means a literal plus. Decoding cannot tell the two apart from the string alone, which is why it is a setting rather than a guess: choose form-urlencoded, or turn on plus-as-space, and pluses become spaces; leave it off and they stay. Encoding has a related trap in the other direction: a literal + in the input must become %2B before spaces are turned into pluses, or a round trip through the encoder silently converts it to a space. That ordering is fixed here, so encode then decode always returns exactly what you started with.
Broken escapes, named precisely
A lone % that is not followed by two hex digits, or a multi-byte sequence cut short like %E0%A4, makes a string undecodable, and the browser's own decoder throws an exception without saying where. Strict mode reports the line and position of the first problem so you can find it in a long list; lenient mode treats an unpaired % as a literal percent sign and returns the rest, which is usually what you want when the input is a log line rather than a real URL. Working line by line matters for the same reason: a single bad entry in a list of fifty tells you which one it was.
Text stays in this tab
The conversion uses the browser's built-in encoding functions and runs entirely locally. Query strings routinely carry tokens and identifiers, so it is worth stating plainly: nothing is uploaded, logged or retained.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent escapes the structural characters : / ? # & = as well, which is right for a single value inside a query string. encodeURI leaves them intact, which is right when the input is a complete address you only need to make safe.
Why does + sometimes mean a space?
Because the form-urlencoded format used by HTML form posts defines it that way. Elsewhere in a URL, + is a literal plus. Since the string alone does not say which applies, decoding offers it as an explicit choice.
What do I do about an invalid percent-encoding error?
The message names the line and position of the first broken escape, usually a lone % that should have been %25, or a truncated multi-byte sequence. Fix it, or switch to lenient decoding to get the rest of the text back.
Does it work on a list of URLs?
Yes, and that is the default. Each line is converted independently, empty lines stay empty, and line breaks are never escaped, so a list goes in and a list comes out.
Are line breaks preserved?
In per-line mode they are, including a trailing newline. Turn per-line off and the whole input is treated as one value, so its own line breaks become %0A inside the result.
How do I decode Cyrillic in an address?
Paste it and decode with the component scheme. Percent-encoded UTF-8 such as %D0%BF%D1%80%D0%B8 is turned back into the original letters; the round trip is lossless in both directions.
Is my text sent anywhere?
No. Encoding and decoding both use functions built into your browser, run locally in this tab, and involve no server and no storage.