UltraConvert
Encoders

URL Encoder & Decoder

Convert between plain text and percent-encoded URL-safe formats. Choose component mode for encoding query parameter values (encodes reserved characters like ? & =), or full-URL mode for entire URLs (preserves URL structure). Essential for building URLs programmatically, debugging encoded parameters, and handling special characters in web addresses.

What does this tool do?

The URL Encoder provides bidirectional percent-encoding for web addresses and URL components. It offers two modes: Component mode (encodeURIComponent) for encoding individual values that will be part of a URL, which encodes nearly all special characters including ? & = / # ; plus spaces as %20; and Full-URL mode (encodeURI) for encoding complete URLs, which preserves URL-reserved characters that have structural meaning. The decoder handles either format and provides clear error messages for malformed percent-encoding.

How it works

The tool uses JavaScript's built-in encoding functions with careful character set handling. For component encoding, encodeURIComponent is used which escapes all characters except A-Z a-z 0-9 - _ . ! ~ * ' ( ). For full-URL encoding, encodeURI preserves the URL structure characters ; / ? : @ & = + $ , # while encoding others. Decoding uses decodeURIComponent which unescapes all percent-encoded sequences back to their character representations. Invalid percent sequences (like %ZZ or trailing %) are detected and reported with helpful error messages.

Features

How to use

  1. 1

    Select mode

    Choose Encode (plain → URL) or Decode (URL → plain).

  2. 2

    Choose component or full URL

    Component encodes ? & = # / — use for single values like search queries. Full-URL preserves these reserved characters — use for complete web addresses.

  3. 3

    Enter and convert

    Paste your text or URL. Output updates instantly showing the encoded or decoded result.

  4. 4

    Copy result

    Click Copy to grab the result for your code, URL construction, or debugging.

Common use cases

Building URLs programmatically

Encode user input or variable values when constructing URLs in JavaScript, Python, or other languages to ensure special characters don't break the URL structure.

Debugging URL parameters

Decode messy query strings to understand what data is actually being passed, or verify your encoding produced the expected output.

Form data preparation

URL-encode form field values for application/x-www-form-urlencoded submission, the standard for HTML form posts.

API request construction

Properly encode query parameters for REST API calls, ensuring characters like spaces, ampersands, and equals signs are handled correctly.

Tips & best practices

Frequently asked questions

When should I use component vs full URL?
Use component when encoding a single piece of data that will become part of a URL (a search query, a slug, a parameter value). Use full-URL when you have an entire URL and just want to escape unsafe characters like spaces or non-ASCII characters while preserving URL structure.
Why does my input get rejected on decode?
Malformed % sequences throw URIError. Every % must be followed by exactly two valid hex digits (0-9, A-F, a-f). Common issues: %ZZ (invalid hex), %2 (only one digit), trailing % at end of string.
Does this handle UTF-8?
Yes — modern URL encoding uses UTF-8 for non-ASCII characters. Each UTF-8 byte is percent-encoded. 'café' becomes 'caf%C3%A9' where %C3%A9 is the UTF-8 encoding of 'é'.
Why is space %20 and sometimes +?
%20 is the percent-encoded space, valid everywhere. + represents space only in application/x-www-form-urlencoded format (HTML form posts). In URLs, %20 is preferred; this tool uses %20 in component mode.

Related tools