URL Encode & Decode Online - Free URL Encoder / Decoder

Instantly url encode decode any string or query parameter in your browser. No sign-up, no uploads, 100% private. Includes JS & Python examples.

Tool options

Mode

Options

Input
48 chars · 1 lines · 48 bytes
Output

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

  1. Paste your raw URL, query string, or encoded text into the input box above.
  2. Choose Encode or Decode from the mode toggle.
  3. Copy the result with the one-click copy button.

Worked example

Suppose you need to pass a search query as a URL parameter:

StageValue
Raw inputhello world & beyond?
Encoded outputhello%20world%20%26%20beyond%3F
Decoded backhello 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.

CharacterPercent-encodedWhy it matters
Space%20Breaks URL parsing everywhere
&%26Splits query parameters
?%3FMarks the start of a query string
#%23Marks a page anchor (fragment)
/%2FSeparates URL path segments
=%3DSeparates 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.

Frequently asked questions

Is my data uploaded or stored anywhere?+
No. The tool runs entirely in your browser using built-in JavaScript functions. Nothing you paste is sent to any server, and nothing is stored or logged.
What is the difference between encodeURI and encodeURIComponent?+
encodeURI() is for encoding a full URL — it leaves characters like : / ? # & = alone because they're part of the URL structure. encodeURIComponent() encodes everything, including those characters, so it's the right choice when you're encoding a single query parameter value.
What's the difference between URL encoding and Base64?+
URL encoding (percent-encoding) replaces unsafe characters with %xx hex sequences so a URL stays valid. Base64 encodes arbitrary binary data into printable ASCII characters — it's used for images in email or JWTs, not for making URLs safe. They solve different problems.
Why does a space sometimes appear as + instead of %20?+
The + sign for spaces is part of the older application/x-www-form-urlencoded format (HTML form submissions). It is NOT standard percent-encoding. If you're building a URL manually, always use %20. Our tool uses standard percent-encoding.
How do I URL encode a string in Python?+
Use urllib.parse.quote(string) from the standard library — no extra packages needed. To decode, use urllib.parse.unquote(string).
How do I URL decode a string in JavaScript?+
Call decodeURIComponent(encodedString). If the encoded text contains a full URL (not just a parameter), use decodeURI() instead, which leaves structural characters like # and & untouched.
Is this tool free? Do I need to sign up?+
Completely free, no account required, no ads popups. Just paste and go.
Can it handle long or complex strings?+
Yes — the tool uses your browser's own JavaScript engine, so it can handle very long strings without any server-side limits. Performance depends only on your device.