Snipget.ai

URL percent-encode or decode

Exact
encoding_url_escape

Deterministic and authoritative — the canonical answer for this input.

Percent-encode or decode a string for use in URLs. mode='encode' or 'decode'; plus uses the form-urlencoded convention (space ⇄ +). Decode is strict: a '%' not followed by two hex digits is rejected as is_valid:false (a literal percent must be encoded as '%25'). Processing multiple inputs? Use `encoding_url_escape_batch` to do up to 1000 in one call.

Parameters

valuestringrequired

Text to percent-encode, or an encoded string to decode.

modestringoptional

'encode' or 'decode'.

plusbooleanoptional

Use form-urlencoded convention (space ⇄ +).

Call it

curl -X POST https://api.snipget.ai/v1/encoding/url-escape \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"a b&c","mode":"encode"}'

The Batch tab sends up to 1000 inputs in one call via /v1/encoding/url-escape/batch.

Example response

{
  "input": "a b&c",
  "is_valid": true,
  "mode": "encode",
  "output": "a%20b%26c",
  "plus": false
}

FAQ

Why do I need to percent-encode a URL?

Spaces and characters like &, ?, and = have special meaning in a web address, so dropping raw text into a link can break it. This converts them into safe percent codes (a space becomes %20), so the link works reliably.

Can it decode an encoded URL too?

Yes. Set mode to 'encode' to make text URL-safe, or 'decode' to turn percent codes like %20 back into the readable original. Decoding is strict: a % that is not followed by two hex digits is rejected with is_valid false rather than passed through silently (a literal percent belongs in a URL as %25).

What is the plus option?

Web forms use a slightly different convention where a space becomes a + instead of %20. Turn on plus to use that form-style encoding (and to decode + back into a space).

When should I use this instead of the HTML entities tool?

Use this one for anything going into a web address or query string. Use the HTML entities tool for text that will be shown on a web page. They solve different escaping problems and aren't interchangeable.

Is the result trustworthy?

Yes. URL encoding is exact and deterministic, so the same input always yields the same correct output.

Related tools