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.

Feedback
Buy Me a Coffee at ko-fi.com