URL Encoder & Decoder
Encode and decode URLs or URI components online. Live conversion as you type, with plus-to-space handling: everything runs locally.
How to use
- Pick a direction at the top: "Encode" turns Chinese, spaces and special characters into %XX sequences; "Decode" converts %XX back into readable text.
- Pick a mode: "Component" follows encodeURIComponent / decodeURIComponent and is meant for single parameter values; "Full URI" follows encodeURI / decodeURI and keeps structure characters like :// ? & =.
- Type or paste into the input box: conversion is live, no button press needed.
- When decoding, + is restored as a space by default (the query-string convention); untick the option if your + signs are literal plus characters.
- Invalid % escape sequences are kept as-is with a warning instead of failing the whole conversion; the result can be copied with one click.
FAQ
What is the difference between "Component" and "Full URI"?
Why did some + signs become spaces?
What happens to invalid % sequences?
Is my content uploaded?
How to use
- Pick a direction
The Encode chip is active by default. It turns Chinese, spaces and special characters into %XX sequences. Press Decode to convert percent-escapes back into readable text.
- Match the mode to your input
Choose Component for single parameter values; it escapes reserved characters like = & ?. Choose Full URI for complete addresses, which keeps structure characters such as :// intact.
- Type and copy live
Paste or type into the input box and the result updates live. No button press is needed; copy straight from the output area below.
- Handle plus signs carefully
When decoding, + is restored as a space by default. Untick the checkbox if your plus signs are literal characters, as in Base64 payloads.
- Read the warnings
Invalid % escape sequences are kept as-is and reported in a yellow notice. The conversion does not fail, so partially broken input still yields usable output.
About this tool
URLs admit only a limited character set. Chinese text, spaces and reserved symbols like & = ? must become %XX percent-escapes before they travel inside a link. This tool converts in both directions under two rules. Component mode follows encodeURIComponent and escapes reserved characters too. Full URI mode follows encodeURI and keeps the URL skeleton intact. Conversion runs live as you type.
Use it to debug API links with Chinese or special-character parameters. It can also repair callback URLs that broke after escaping. Build download links containing spaces, or turn log entries full of percent-encoded sequences back into readable text. Everything runs locally in the browser, so links carrying tokens or private parameters are safe to paste. A yellow notice reports any invalid sequences that were preserved.
How it works
RFC 3986 defines percent-encoding: letters, digits and the four symbols - _ . ~ are unreserved and travel as-is, while everything else becomes %XX byte sequences. Encoding works on bytes, not characters. The two built-in JavaScript functions differ on reserved characters. encodeURI escapes only characters outside the URL skeleton. encodeURIComponent escapes the delimiters = & ? as well. This tool's two modes map onto those two rules. UTF-8 spends three bytes on one Chinese character. The result is the nine-character sequence %E4%BD%A0, so long links visibly swell.
The plus sign is a historical exception. The application/x-www-form-urlencoded format used by HTML forms writes a space as +, while RFC 3986 treats the plus as an ordinary sub-delim. When you decode a key=value query string, restore + as a space. Outside that form context, a plus is just a literal character. Decoding Base64 or HMAC signatures requires the option to be off, or the bytes come back wrong. Invalid sequences such as %ZZ are kept as-is with a yellow notice instead of failing the whole conversion, which leaves room for debugging.
When to use it
- Comparing encoders across systems
The frontend may follow component rules while the backend follows full-URI rules. Convert the same value in both modes here and the diverging character shows up immediately.
- Chasing tracking parameters that vanish
An unescaped & inside an analytics URL ends the parameter list early and silently drops every field after it. Encode the values before assembling the link and the dashboard numbers return to normal.
- Unpacking multi-hop marketing links
Campaign URLs accumulate layers of encoding across redirects, so parameters look mangled by the time they land. Decode segment by segment to see what each hop added and who touched the link.
Tips & tricks
- Keep plus-to-space enabled for form query strings, but untick it before decoding Base64 values or you will corrupt the output.
- Never encode a whole URL in Component mode; escaped & and = destroy parameter boundaries. Reserve it for individual values.
- A %2F in the output is a slash; decode path segments individually when you need to split or rebuild a path.
Things to watch
- Stop decoding once it reads right
Decoding can be repeated, but more passes are not better. Leftover percent signs mean another layer remains; readable text should be left alone. A further pass can shred content that merely looks like an escape.
- Preserved invalid sequences are still broken
The yellow notice means the characters after % form no legal escape, and keeping them as-is only aids debugging. Such output still fails in a redirect, so repair the source data before using it.
- Keep the charset aligned with UTF-8
The same Chinese character encodes differently in UTF-8 and GBK, and this tool works in UTF-8. When sequences come from a legacy GBK source, align the charset before comparing anything.