URL Encoder/Decoder
Encode/decode URLs.
Loading tool…
What is percent-encoding?
URLs may only contain a restricted set of characters. Anything outside it — spaces, quotes, ampersands, slashes inside a value, Arabic or Chinese text, emoji — must be percent-encoded: each byte is written as a percent sign followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, and a non-Latin character becomes several escapes because it is several bytes in UTF-8.
Encoding the wrong characters breaks things just as thoroughly as encoding none. A slash separating path segments must stay a slash, while a slash inside a query value must become %2F. An ampersand separating parameters must stay, while an ampersand inside a value must be escaped or it will split the parameter in two. This is why JavaScript offers two functions — encodeURI for a whole URL and encodeURIComponent for a single value — and why using the wrong one is a common bug.
Why we built this tool
You reach for this while building query strings, debugging an OAuth redirect that keeps failing, reading a callback URL out of a log, or working out what a long tracking link contains.
Those URLs regularly carry session tokens, one-time codes, and email addresses in their parameters — sometimes still valid. Pasting them into a website hands a live credential to a stranger. Ours encodes and decodes in your browser using the built-in URL functions, with no network request, no logging, and no length limit. It answers instantly and keeps working when the connection does not.
Tips and common mistakes
- Encode a whole URL and a single parameter value differently — the rules are not the same.
- A space becomes
%20in a path and may be a plus sign in a query string, depending on the convention in use. - Double-encoding is a common bug: a
%2520in a URL means something was encoded twice. - Non-Latin characters expand to several escapes each, which is correct.
Open URL Encoder/Decoder with a link
Assistants and scripts can open URL Encoder/Decoder with its input already in the link, after the #, which never leaves your device:
#text=— the text to work on
Example: https://mygadgets.ink/tools/url-encoder-decoder/#text=... · also compressed gz fields and ?url=. How tool links work
Quick start: using URL Encoder/Decoder
- Paste the URL or the value you need to convert.
- Choose encode or decode.
- For encoding, decide whether you are handling a whole URL or a single parameter value.
- Check that structural characters such as slashes and ampersands survived as intended.
- Copy the result into your request, config, or bug report.
To break a link into its parts instead, use URL Parser.
Why URLs need encoding
URLs can only reliably contain a limited set of characters. Spaces, and symbols like ?, &, #, /, and =, have special structural meaning in a URL — they separate the parts. So when those characters need to appear inside a value rather than as structure, they must be escaped, or they would break the link or be misread. URL encoding (also called percent-encoding) replaces each unsafe character with a % followed by its code.
What the codes mean
Each % code is the character's byte value in hexadecimal. The common ones you will recognize:
%20— a space.%3F— a question mark.%26— an ampersand.%23— a hash.%2F— a forward slash.
A search for "cats & dogs" becomes cats%20%26%20dogs in the URL, so the & is treated as literal text rather than a parameter separator.
When you need each direction
- Encode when you are building a URL and putting user input or special characters into it — a search term, a value with spaces or symbols, a redirect target. Skipping this is a classic source of broken links.
- Decode when you are reading a URL and want the human-readable version — inspecting a link, debugging a parameter, or extracting a value someone sent you.
A common confusion
URL encoding is not Base64, and not the same as encoding the whole URL. You typically encode the values inside a query string, not the structural characters that make the URL work — encoding the ? and & that separate parameters would break it. Encode the pieces that go into the slots, not the slots themselves.
Common uses
- Build a link with special characters or spaces.
- Read an encoded URL you were sent.
- Debug a broken query parameter.
- Escape a search term or redirect value.