Code and data

URL encode and decode

Encode or decode a link, a query value or a form body. A whole link keeps : / ? and &, a single value encodes those characters, and a form body writes a space as +.

Runs in your browser. Nothing you type or open is uploaded. Free to use, no account. More code and data tools

How to use it

  1. Paste the text.
  2. Choose encode or decode, and the rule that matches the text.
  3. Copy the result.

Three ways to percent-encode

A whole link uses the same rules as encodeURI. Letters, digits and the characters : / ? & = # stay in place, and a space or an accented letter becomes a percent sequence. One value uses the rules of encodeURIComponent, so a space is %20 and a slash is %2F. A form body matches application/x-www-form-urlencoded: a space is +, and a + in the encoded text comes back as a space.

A percent sign needs two hex digits after it. When those digits are missing, the message names the position. The text you paste stays in this tab, and the direction and the rule can travel in the page link.

Private by design

Privacy

Everything runs in this page and stays on your device. Text you paste stays in this tab. Choices such as a format or a font size can be shared in the page link.

This page also shows Google ads, which can use cookies. Privacy and cookies explains how.

Questions

Which rule should I pick?

Use the whole-link rule for a URL you want to keep readable. Use the one-value rule for a piece that will sit inside a query string. Use the form-body rule when the text came from a form post.

What happens to a space?

The whole-link and one-value rules write a space as %20. The form-body rule writes it as +, and decoding that rule turns + back into a space.

What does a broken percent sequence look like?

A % needs two hex digits. The message names the sequence and the position, such as a lone % or a %2.

Does this turn a domain into punycode?

This page percent-encodes the characters you give it. Internationalized domain names stay with the browser’s own URL parser.

From the same developer