🔗

URL Encoder / Decoder

Percent-encode special characters or decode an encoded URL — instantly, in your browser.

Plain text

0 chars

Encoded

Reference

encodeURIComponent

Encodes every character except A-Z a-z 0-9 - _ . ~. Use it for query string values and path segments.

encodeURI

Preserves URL structural characters like / : ? & = #. Use it on a complete URL when you only want to escape spaces and unicode.

About this tool

Free online URL encoder and decoder. Convert any string into a percent-encoded URL component, or decode an existing encoded URL back to its readable form. Supports both encodeURIComponent (full escaping) and encodeURI (preserves URL structure) variants.

Real-time encoding and decoding
🔁Encode and decode in one tool
🧩Both encodeURIComponent and encodeURI
🛡️100% client-side — your data never leaves your browser
📋One-click copy to clipboard
🆓Free, no sign-ups, no usage limits

How to use it

Quick steps to get the most out of this utility.

  1. 1

    Choose Encode or Decode

    Switch between encoding plain text into a URL-safe string and decoding an already-encoded URL.

  2. 2

    Pick the variant

    Use Component for query string values and path segments (escapes everything). Use Full URL when you have a complete URL and want to preserve / : ? & =.

  3. 3

    Paste your input

    The output appears instantly as you type. There is no submit button.

  4. 4

    Copy or swap

    Use the Copy button to grab the result, or Swap to feed the output back as input for the opposite operation.

Why URL encoding matters

URLs have a fixed grammar. Characters like ?, &, and = separate the path, query string, and key/value pairs. If the actual data you want to send contains those characters, it must be escaped — otherwise the receiving server will misinterpret your input.

The encoded form is unambiguous. %20 is always a space; %26 is always an ampersand that should be treated as data, not as a parameter separator.

Common use cases

  • Building search query strings: ?q=hello%20world
  • Passing URLs as parameters in OAuth redirect flows
  • Constructing REST API paths with user-provided IDs that might contain spaces or slashes
  • Embedding URLs inside JSON config files for tools that don't auto-escape

Frequently asked questions

What is URL encoding?+

URL encoding (also called percent encoding) replaces unsafe characters in a URL with a percent sign followed by two hex digits. For example, a space becomes %20 and an ampersand becomes %26. This makes URLs safe to transmit through systems that have reserved meanings for those characters.

When should I use encodeURIComponent vs encodeURI?+

Use encodeURIComponent for individual URL parts like query string values and path segments — it escapes almost everything. Use encodeURI when you have a complete URL and only want to escape spaces and unicode while preserving structural characters like / : ? & = #.

Is URL encoding the same as HTML encoding or Base64?+

No. URL encoding only escapes characters with special meaning in URLs. HTML encoding converts characters like < and > into entities like &lt; and &gt;. Base64 transforms arbitrary binary into a 64-character ASCII alphabet — a completely different concept.

Is my data sent to any server?+

No. The URL encoder runs entirely in your browser using built-in JavaScript functions. Nothing is uploaded.

Why does decoding fail with "URI malformed"?+

JavaScript throws this error when it encounters an invalid percent-escape sequence — for example a stray "%" not followed by two hex digits. Check that every "%" in the input is followed by a valid two-character hex code.

Keep exploring

More utilities and reading from Toolisk.