b2KIT

URL Encoder / Decoder

Encode special characters for URLs or decode percent-encoded URL strings.

How to Use URL Encoder / Decoder

  1. 1

    Paste your URL

    Enter the URL or string to encode or decode.

  2. 2

    Choose the action

    Select encode to percent-encode or decode to restore the URL.

  3. 3

    Copy the result

    Click copy to grab the encoded or decoded URL string.

Tested tool guide Developer and data tools Checked July 30, 2026

What URL Encoder / Decoder does, with a checked example

Use this page for values that belong inside a URL, such as a query parameter, path segment, or fragment value. The encoder uses encodeURIComponent, which escapes reserved punctuation as well as spaces. It is intentionally stricter than encoding a complete URL because separators such as slash, question mark, ampersand, and equals may be data inside a component.

Worked example

A concrete input and expected output from the current implementation.

Input

honey & tea

Expected output

honey%20%26%20tea

Each space becomes %20 and the ampersand becomes %26. Decoding the result returns the original eleven-character value.

How the result is produced

1

Percent triplets represent UTF-8 bytes

Unsafe characters are converted to UTF-8 and written as percent followed by two hexadecimal digits per byte. Non-ASCII characters can therefore produce several percent triplets.

2

Components and complete URLs differ

Encoding a whole URL with encodeURIComponent also escapes its structural separators. Enter only the value that needs escaping unless you deliberately want the complete URL represented as data.

Good uses

  • Prepare a search term for a query-string parameter.
  • Decode a copied callback value while debugging OAuth.
  • Make a filename or label safe inside a URL path segment.

Limits and checks

  • A percent sign must be followed by two valid hexadecimal digits when decoding.
  • A plus sign is not converted to a space by decodeURIComponent.
  • Encoding does not validate whether the eventual host or full URL is trustworthy.

Common questions

Why is an ampersand encoded?

Ampersand separates query parameters in a URL. Encoding it as %26 keeps it inside one parameter value instead of starting another parameter.

Should slashes be encoded?

Inside one path segment, usually yes. Between path segments, no. Decide whether the slash is data or part of the URL structure before encoding.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools