Paste a URL or text, get the encoded (or decoded) result instantly
Special characters like spaces, ampersands, and hash signs can break URLs silently. This tool converts any text to a safe, percent-encoded string — or reverses it back to plain text — in one click, right in your browser.
Your data never leaves your device. Nothing is uploaded to any server.
How to url encode decode in 3 steps
- Paste your raw URL, query string, or encoded text into the input box above.
- Choose Encode or Decode from the mode toggle.
- Copy the result with the one-click copy button.
Worked example
Suppose you need to pass a search query as a URL parameter:
| Stage | Value |
|---|---|
| Raw input | hello world & beyond? |
| Encoded output | hello%20world%20%26%20beyond%3F |
| Decoded back | hello world & beyond? |
The space becomes %20, the ampersand becomes %26, and the question mark becomes %3F. Any server in the world can read that safely.
Common percent-encoded characters (quick reference)
This table covers the characters that cause the most trouble. Use it to decode a garbled URL by hand, or to double-check encoder output.
| Character | Percent-encoded | Why it matters |
|---|---|---|
| Space | %20 | Breaks URL parsing everywhere |
& | %26 | Splits query parameters |
? | %3F | Marks the start of a query string |
# | %23 | Marks a page anchor (fragment) |
/ | %2F | Separates URL path segments |
= | %3D | Separates a key from its value |
Encode a whole URL vs. a single value: JavaScript's encodeURI() encodes a complete URL but deliberately leaves structural characters like : / ? # & = untouched, because those characters are part of the URL structure. encodeURIComponent() escapes everything — use it when encoding a single query-string value so those characters can't be misread as URL delimiters.
How to do this in JavaScript
// Encode a single query value (most common need)
const raw = 'hello world & beyond?';
const encoded = encodeURIComponent(raw);
console.log(encoded); // hello%20world%20%26%20beyond%3F
// Decode it back
const decoded = decodeURIComponent(encoded);
console.log(decoded); // hello world & beyond?
How to do this in Python
from urllib.parse import quote, unquote
raw = 'hello world & beyond?'
encoded = quote(raw) # 'hello%20world%20%26%20beyond%3F'
decoded = unquote(encoded) # 'hello world & beyond?'
Python's quote() is equivalent to JavaScript's encodeURIComponent() by default. Pass safe='/' if you want forward slashes left unencoded.
How it works
Percent-encoding (defined in RFC 3986) replaces each unsafe byte with a % sign followed by two hexadecimal digits. For example, a space (byte value 32, or 0x20 in hex) becomes %20. The tool uses the browser's built-in decodeURIComponent and encodeURIComponent functions so the result is always spec-compliant.
Non-ASCII characters (like accented letters or emoji) are first converted to their UTF-8 byte sequence, then each byte is percent-encoded. That's why a single emoji can produce a long chain of %xx tokens.
When to use percent-encoding — and when not to
- Use it when you're building a query string from user input (search terms, form fields, file names).
- Use it when an API requires an encoded callback URL or redirect URI in a parameter.
- Use it when you receive an encoded string from a log file or network trace and need the original value.
- Don't encode the whole URL if the URL already has its structure intact — you'll double-encode the
://and break the link. - Don't confuse it with Base64 — Base64 encoding (used for binary data and email attachments) produces a completely different output. Percent-encoding is specifically for URL safety.
- If you're building clean, human-readable URLs from plain text (e.g. blog post titles), you probably want our Slug Generator — Turn Any Text Into Clean URL Slugs instead.
MDN has a thorough reference for encodeURIComponent on MDN Web Docs if you want to go deeper into the browser API.
Takeaway: if a URL is misbehaving or an API is rejecting your parameter, a quick encode or decode here will show you exactly what's going on — paste it above and see.