AlpaKit Logo AlpaKit

URL Encoder & Decoder

Percent-encode or decode URLs and query parameters with encodeURI or encodeURIComponent.

Keeps : / ? & = # intact — for a whole link

URL Breakdown
Protocol https:
Host example.com
Path /搜尋
Query q → 網址 編碼
Query lang → zh-TW
Hash (#) —

How to use this tool

  1. 1 Open URL Encoder & Decoder, then enter, paste, or choose the content you want to process.
  2. 2 Adjust the available options and output format for your task.
  3. 3 Review the instant result, then copy or download the available output.

Common use cases

Percent-encode or decode URLs and query parameters with encodeURI or encodeURIComponent. Use it for everyday work, development, learning, or quick verification.

Privacy and data handling

This tool runs in your browser. Before working with sensitive data, make sure you trust your browser and device environment.

URL Percent-Encoding, encodeURI vs. encodeURIComponent

Under RFC 3986, URIs can only contain a restricted set of ASCII characters directly. Non-ASCII characters (such as CJK characters or emoji), spaces, and reserved symbols must be converted into UTF-8 bytes and represented as % followed by two hexadecimal digits (percent-encoding). For example, the character "你" is three UTF-8 bytes and encodes to %E4%BD%A0.

Two encoding scopes serve different tasks: "Full URL (encodeURI)" preserves URI structure delimiters such as :, /, ?, #, &, and =, making it suitable for encoding an entire web address. "URL Component (encodeURIComponent)" escapes those delimiters as well, which is required when embedding a single query value or path segment.

In HTML form submissions (application/x-www-form-urlencoded), spaces are encoded as + instead of %20. Enabling "Treat + as space" in Decode mode converts literal + characters to spaces before percent-decoding while keeping %2B as a literal +.

Frequently asked questions

When should I choose encodeURI vs. encodeURIComponent?

Use encodeURI when you have a complete URL starting with https:// and want to keep :, /, ?, &, and = intact. Use encodeURIComponent when encoding an individual query parameter value (such as a search term or a callback URL passed inside ?redirect=...).

Why does decoding show a malformed percent-encoding error?

Every % in an encoded string must be followed by two valid hexadecimal digits (0-9, A-F), and multi-byte sequences must form valid UTF-8 code points. A bare % sign or a truncated multi-byte sequence (such as %E4%BD) will fail decoding and report the approximate character position.

What is the difference between + and %20 in a URL?

RFC 3986 defines %20 as the standard percent-encoding for a space, whereas application/x-www-form-urlencoded form query strings represent spaces with +. Turn on "Treat + as space" when decoding form-encoded query strings.

Does decoding also convert %2F, %3A and similar sequences?

Yes. Decode mode always performs a full decode (equivalent to decodeURIComponent), so %3A, %2F, %3F, %26 and %3D become :, /, ?, & and = again. For example, https%3A%2F%2Falpakit.dev%2Fa%3Fx%3D%E5%BF%AB decodes to https://alpakit.dev/a?x=快. Only encoding needs the Full URL or URL Component choice; decoding has no scope option.

Browse this category: Dev Tools

Suggested & Recent Tools
    ↑ ↓ Navigate ↵ Open ESC Close
    咩~
    Alpa Idle Alpa Walk 1 Alpa Walk 2 Alpa Walk 3 Alpa Walk 4 Alpa Dizzy Alpa Sleep