URL Encoder / Decoder Online

A free online URL encoder and decoder. Instantly encode any text or URL into percent-encoded format and decode any percent-encoded string back to readable form. Features full support for both encodeURIComponent and encodeURI, a built-in URL analyzer, and real-time output.

Loading URL Encoder...

🔒 Trust and Privacy Notice: This URL encoder and decoder runs entirely in your browser using native JavaScript APIs. No text or URLs you enter are ever sent to any server. Everything is processed locally on your device.

How to URL Encode Text

  1. Select the Encode tab at the top of the tool
  2. Choose your encoding type — encodeURIComponent for query values or encodeURI for full URLs
  3. Type or paste your text or URL into the input panel
  4. The URL encoded output appears instantly in the output panel
  5. Click Copy Encoded to copy the result to your clipboard

How to URL Decode a String

  1. Select the Decode tab at the top of the tool
  2. Paste your percent-encoded string into the input panel
  3. The decoded plain text appears instantly in the output panel
  4. The tool handles both %20 style and mixed encoded strings automatically
  5. Click Copy Decoded to copy the result to your clipboard

How to Use the URL Analyzer

  1. Scroll to the URL Analyzer section below the main tool
  2. Paste any complete URL including the protocol (e.g. https://example.com/path?q=hello)
  3. The tool instantly breaks the URL into protocol, host, port, path, query string, and fragment
  4. All query parameters are listed individually with both their encoded and decoded values
  5. Use this to debug malformed URLs or inspect API endpoint query strings

encodeURIComponent vs encodeURI — When to Use Which

encodeURIComponent should be used when encoding individual query parameter values. It encodes virtually all special characters including &, =, ?, /, and #. This prevents these characters from breaking the URL structure when they appear inside a parameter value.

encodeURI should be used when encoding a complete URL. It preserves structural characters like ://, /, ?, &, =, and # because these are needed for the URL to work. It only encodes characters that are completely invalid in a URL.

Rule of thumb: if you are encoding a value that will go inside a query string parameter, use encodeURIComponent. If you are encoding an entire URL, use encodeURI.

Common Use Cases

  • Building API request URLs with user-supplied query parameters
  • Encoding redirect URLs passed as query parameters
  • Debugging malformed URLs in server logs or API responses
  • Creating shareable links with pre-filled search queries
  • Safely passing email addresses, names, or messages in URL query strings
  • Encoding data for use in HTML href attributes
  • Analyzing and debugging complex URLs with many query parameters

Key Features

  • Real-time encoding and decoding — output updates as you type
  • Supports both encodeURIComponent and encodeURI encoding types
  • Built-in URL Analyzer — breaks any URL into components and parses query parameters
  • Character statistics — shows how many characters were encoded and size change
  • Sample data buttons for instant exploration
  • Copy, paste, clear, and swap action buttons
  • Common URL encoding reference table
  • Works on all devices including mobile
  • 100% free — no signup, no account, no data uploaded

Frequently Asked Questions

What is URL encoding?

URL encoding, also called percent encoding, converts characters that are not allowed in URLs into a format that can be safely transmitted. Special characters are replaced with a percent sign followed by their two-digit hexadecimal code, for example a space becomes %20.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a complete URL but preserves characters that have special meaning in URL structure like /, ?, #, and &. encodeURIComponent encodes everything except letters, digits, and a few safe symbols, making it suitable for encoding individual query parameter values.

When should I use URL encoding?

Use URL encoding when passing special characters in query string parameters, when building URLs programmatically, when submitting form data via GET requests, and when including user input in URLs to prevent broken links or security issues.

Why does a space become %20 in URLs?

Spaces are not allowed in URLs according to the RFC 3986 standard. URL encoding replaces the space character with its hexadecimal ASCII code prefixed by %, which is %20. Some older systems use + to represent spaces in query strings instead.

What is percent encoding?

Percent encoding is another name for URL encoding. It replaces unsafe or reserved characters in a URL with a percent sign followed by the character's two-digit hexadecimal UTF-8 code. For example & becomes %26 and = becomes %3D.

Can I decode a URL encoded string online?

Yes. Switch to the Decode tab, paste your percent-encoded string, and the decoded output appears instantly. The tool handles both encodeURIComponent and encodeURI encoded strings automatically.

Is this URL encoder tool free?

Yes, completely free with no account or signup required. All encoding and decoding happens entirely in your browser. No data is ever sent to any server.

What does the URL Analyzer do?

The URL Analyzer breaks down any URL into its components — protocol, host, port, path, query string, and fragment. It also parses individual query parameters and shows both their raw encoded values and decoded values side by side.