← Home

URL Encoder/Decoder

Mode:
Input 0 chars
Output 0 chars

Features

100% Private

All encoding and decoding runs locally in your browser. No data is sent to any server.

Two Encoding Modes

Switch between encodeURIComponent (for parameters) and encodeURI (for full URLs) with one click.

Real-Time Conversion

Results update instantly as you type — no need to click a button for every change.

Full Unicode Support

Correctly handles multi-byte characters: Chinese, Japanese, Korean, Arabic, emoji, and more.

Auto-Detect Direction

Automatically detects whether input is encoded or plain text and converts accordingly.

Swap Input/Output

Quickly swap encoded and decoded text with the Swap button for bidirectional workflow.

How to Use

Select the Encoding Mode

Choose encodeURIComponent for URL parameters or encodeURI for complete URLs. The default mode handles most use cases.

Enter Your Text or URL

Paste a URL, query string, or any text with special characters into the input area. The tool auto-detects if decoding is needed.

Click Encode or Decode

Click the Encode button to percent-encode, or Decode to convert percent-encoded strings back to readable text.

Copy the Result

Click Copy to copy the output to your clipboard. Use Swap to quickly reverse the operation.

encodeURI vs encodeURIComponent

Character encodeURI encodeURIComponent Notes
Space ( )%20%20Both encode spaces
Slash (/)/ (kept)%2FURI preserves path separators
Colon (:): (kept)%3AURI preserves protocol separator
Question (?)? (kept)%3FURI preserves query delimiter
Ampersand (&)& (kept)%26URI preserves param separator
Equals (=)= (kept)%3DURI preserves key-value delimiter
Hash (#)# (kept)%23URI preserves fragment identifier
Chinese (中)%E4%B8%AD%E4%B8%ADBoth encode non-ASCII to UTF-8 bytes

Frequently Asked Questions

What is URL encoding (percent-encoding)?
URL encoding, also called percent-encoding, replaces unsafe or reserved characters in URLs with a % sign followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20 and an ampersand becomes %26. This ensures URLs are valid and can be transmitted correctly across all systems.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL, preserving structural characters like :, /, ?, #, &, and = that have meaning in URL syntax. encodeURIComponent encodes a single URL component (like a query parameter value), encoding all special characters including those preserved by encodeURI. Use encodeURIComponent for parameter values and encodeURI for complete URLs.
Why do spaces become %20 in URLs?
Spaces are not allowed in URLs per RFC 3986. The standard percent-encoding representation of a space is %20. The + sign for spaces is a legacy convention from HTML form encoding (application/x-www-form-urlencoded) and is not part of standard URL percent-encoding.
Can I encode non-Latin characters like Chinese, Arabic, or emoji?
Yes. Non-ASCII characters are first converted to their UTF-8 byte sequence, then each byte is percent-encoded. For example, the Chinese character '中' (U+4E2D) becomes %E4%B8%AD in a URL because its UTF-8 encoding is 3 bytes: 0xE4, 0xB8, 0xAD.
Is my data sent to a server?
No. All encoding and decoding uses JavaScript's built-in encodeURI / decodeURI / encodeURIComponent / decodeURIComponent functions running entirely in your browser. Nothing is transmitted to any server.
When should I use URL encoding in web development?
Use URL encoding whenever you include user-generated or dynamic data in URLs — query parameters, form data, path segments, and fragment identifiers. It prevents broken URLs, injection attacks, and ensures correct handling of special characters across browsers and servers.

Related Tools

About URL Encoder / Decoder

Encode and decode URLs online free with FreeToolBox — instantly convert special characters in URLs to their percent-encoded equivalents and back. URL encoding (also known as percent-encoding, defined in RFC 3986) replaces characters not permitted in URLs with a % followed by two hexadecimal digits representing the character's byte value. This is essential for web developers building APIs, constructing query strings, handling form submissions, and debugging URL-related issues in any web application.

The tool provides two industry-standard encoding modes: encodeURIComponent for encoding individual URL parameters (encodes everything except unreserved characters A-Z, a-z, 0-9, -, _, ., ~), and encodeURI for encoding complete URLs while preserving structural delimiters like ://?#&=. It features real-time conversion as you type, automatic detection of encoded vs. plain input, full UTF-8 Unicode support for any language, and a convenient input/output swap function. All processing uses JavaScript's native functions running entirely in your browser — no data ever leaves your device. Completely free, instant, no account required.

Best use cases for URL encoding

When should you use URL Encoder vs other tools?

Use URL Encoder/Decoder when the issue is escaping characters for transport. If you are debugging a bigger API response or payload after decoding, continue with JSON Formatter. If your payload also includes encoded blobs or tokens, pair it with Base64 Encoder/Decoder.

No-upload workflow: internal links, signed parameters, and test URLs stay in your browser instead of being pasted into a third-party encoder.

Frequently Asked Questions

Should I use encodeURI or encodeURIComponent?

Use encodeURI for a full URL that already includes separators like :// and ?a=1. Use encodeURIComponent for a single parameter value, path fragment, or user input that will be inserted into a URL.

Why URL Encoding Exists: Not All Characters Are Safe

URLs are restricted to a small set of unreserved characters. Spaces, and a range of symbols like "&", "=", "#", and non-ASCII text, would break how a URL is parsed, so they must be represented as percent-encoded sequences. That is why a space becomes %20 and a hash becomes %23. Encoding is only a representation — the server decodes it back to the original before using it. Understanding this helps you see why a URL you paste with symbols sometimes works and sometimes does not, depending on whether it was encoded.

Encoding a Whole URL vs. Only the Parts That Need It

There is an important distinction between encoding a whole URL and encoding only a query value. If you encode the entire path, you can break the separators that define the structure, like the slashes and the question mark. Usually you want to encode only the individual data values that pass into the URL, leaving the structural parts intact. When you build a URL from user input, encode each value separately rather than pasting the raw value into the string. This is the difference between a URL that works and one that silently breaks.

Common Decoding Mistakes to Watch For

The most frequent error is decoding something that has already been encoded, which can mangle text, or not encoding something at all, which leaves the URL with characters it cannot carry. Another is treating space and "+" as the same thing; in a query string "+" often means a space, but in the rest of a URL it is a literal plus. When you decode, check the result in the context where it will be used, and remember that a displayed URL is not always the same as the underlying request the browser actually makes.

Feedback
Buy Me a Coffee at ko-fi.com