DevToolbox

URL Encode / Decode

URL Encode / Decode: Encode text so it is safe to drop into a URL, or decode a percent-encoded string back to plain text. Choose component mode (encodeURIComponent) for query values, or full-URL mode (encodeURI) to preserve reserved characters. Everything runs in your browser.

Data as of 2026-06-13.

How it works

URL encoding (percent-encoding) replaces characters that are unsafe or reserved in a URL with a % followed by their hexadecimal byte value, so the value survives transport in a query string or path.

Component mode uses encodeURIComponent, which escapes reserved characters such as &, =, ? and / — use it for individual query values. Full-URL mode uses encodeURI, which leaves those reserved characters intact so a complete URL stays usable. Decoding reverses the matching operation.

Runs fully client-side in your browser. Source: published web standards (RFCs and the WHATWG/W3C specifications), as implemented by your browser. Verified 2026-06-13.

Frequently asked questions

When should I use component mode versus full-URL mode?

Use component mode for a single value you are inserting into a URL (such as a query-string parameter), because it escapes reserved characters. Use full-URL mode when encoding an entire URL that should keep its structure (://, ?, &).

Why did decoding fail with a malformed error?

Decoding fails when the input contains an invalid percent-escape, for example a stray % not followed by two hexadecimal digits. Fix or remove the bad escape and try again.

Does it handle spaces and plus signs?

Percent-encoding represents a space as %20. Note that + meaning a space is a form-encoding convention (application/x-www-form-urlencoded), not part of standard URL percent-encoding, so a literal + is kept as-is here.

Related tools

Last updated: 2026-06-13