{ URL Encoder / Decoder }

// encode & decode URLs instantly

Encode and decode URLs instantly in your browser. Supports encodeURIComponent, encodeURI, and full URI decoding — free, no sign-up required.

%20

Ready to encode

Paste a URL or text and click Encode — or press Ctrl+Enter

HOW TO USE

  1. 01
    Choose a mode

    Select Encode to convert plain text or a URL into percent-encoded form. Select Decode to reverse encoded strings back to readable text.

  2. 02
    Pick encoding method

    Use encodeURIComponent for query parameters and form values. Use encodeURI for full URL strings where slashes and colons must stay intact.

  3. 03
    Copy or Swap

    Click Copy to grab the result. Use Swap to push the output back into the input for chaining operations.

FEATURES

encodeURIComponent encodeURI Decode Mode Swap Input/Output Char Breakdown Live Char Count

USE CASES

  • 🔧 Encode query string parameters safely
  • 🔧 Decode URLs from server logs or network traces
  • 🔧 Fix double-encoded or malformed URLs
  • 🔧 Prepare strings for use in HTTP headers
  • 🔧 Debug OAuth and redirect_uri encoding issues

WHAT IS THIS?

URL Encoder / Decoder converts text and URLs to and from percent-encoded format. Percent encoding replaces unsafe characters with a % followed by two hex digits so they can be safely transmitted in URLs. This tool supports both encodeURIComponent (strict) and encodeURI (full-URL) modes.

RELATED TOOLS

FREQUENTLY ASKED QUESTIONS

What is URL encoding?

URL encoding (percent encoding) replaces characters that are not allowed in URLs with a percent sign followed by their two-digit hexadecimal UTF-8 value. For example, a space becomes %20 and an ampersand becomes %26.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL and leaves structural characters like : / ? # & = untouched. encodeURIComponent encodes everything except letters, digits, and - _ . ! ~ * ' ( ), making it safe for encoding individual query parameter values.

Is my data sent to a server?

No. All encoding and decoding happens directly in your browser using JavaScript. Your input text never leaves your device, so it is safe to use with sensitive URLs, tokens, or credentials.

Why does a space encode as %20 and not +?

The + sign as a space substitute is specific to application/x-www-form-urlencoded format used in HTML forms. Standard percent encoding always uses %20. Both are valid in different contexts, but %20 is safer for general use in URLs.

What does the Swap button do?

Swap copies the current output back into the input field so you can immediately re-encode or re-decode it. This is useful for fixing double-encoded strings or verifying a round-trip encode → decode is lossless.

Can I decode a partially encoded URL?

Yes. The decoder handles strings that are only partially encoded, decoding every %XX sequence it finds while leaving plain text characters unchanged. This is helpful when working with URLs from logs or third-party APIs that apply inconsistent encoding.

URL Encoder / Decoder — Free Online Tool

Every URL that travels across the internet must consist only of a defined set of ASCII characters. When a URL needs to carry data that falls outside that safe set — spaces, special characters, Unicode text, or reserved symbols — those characters must be percent-encoded before transmission. The URL Encoder / Decoder on this page makes that conversion instant and reliable.

What Is Percent Encoding?

Percent encoding, formally defined in RFC 3986, converts each unsafe byte into a three-character sequence: a percent sign followed by two uppercase hexadecimal digits representing the byte value. A space (byte 0x20) becomes %20. A forward slash used inside a query value (byte 0x2F) becomes %2F. For multi-byte UTF-8 characters such as accented letters or emoji, each byte of the UTF-8 representation is encoded separately — so a single emoji can expand into a sequence of twelve or more characters.

encodeURIComponent vs encodeURI

JavaScript exposes two built-in encoding functions with different scopes. encodeURIComponent is the stricter of the two: it encodes everything except unreserved characters (letters, digits, hyphen, underscore, period, tilde). This makes it safe for encoding individual query parameter keys and values, redirect URIs, OAuth tokens, and anything that will appear inside a URL component.

encodeURI leaves the structural characters of a URL — colons, slashes, question marks, hash signs, ampersands, and equals signs — untouched. Use this mode when you have a complete URL and want to encode only the non-ASCII portions without breaking the URL structure.

Common URL Encoding Scenarios

Decoding URLs from Logs and APIs

When reading server access logs, network traces, or responses from third-party APIs, URLs often appear in their encoded form. Decoding them manually to understand what a request actually contained is tedious and error-prone. Paste the encoded string into the decoder, switch to Decode mode, and the tool instantly restores the human-readable form so you can debug the issue without writing a single line of code.

Double Encoding — A Common Bug

A frequent mistake is encoding a URL twice. If a value has already been encoded and gets encoded again, %20 becomes %2520 because the percent sign itself gets encoded as %25. The Swap feature on this tool lets you verify a round-trip: encode a value, then swap and decode it — the output should match the original input exactly. If it does not, a double-encoding problem is present somewhere in the pipeline.