URL encoder and decoder

Percent-encode text for a URL or decode %20-style escapes back to text. Component, full-URL and form styles, with any URL broken into its parts. Runs in your browser.

Loading…

How it works

  1. 1

    Pick encode or decode

    Encode makes text safe to put in a URL; decode turns %-escapes back into readable text.

  2. 2

    Choose the style

    Component for a single query value or path segment, Full URL to keep : / ? # & intact, or Form for HTML form data where spaces become +.

  3. 3

    Inspect the URL

    Paste a full URL to see its protocol, host, port, path, hash and every query parameter decoded in a table.

Questions

encodeURIComponent or encodeURI?
Use component (encodeURIComponent) for a piece of a URL, like a query value: it escapes & = ? / and #. Use full URL (encodeURI) for a complete address, which must keep those characters.
Why do spaces become + sometimes and %20 other times?
HTML forms send data as application/x-www-form-urlencoded, where a space is +. Everywhere else in a URL a space is %20. Pick Form or Component to match what you’re working with.
Why does decoding fail?
A % must be followed by two hex digits, and the bytes must form valid UTF-8. The error says exactly which escape is wrong.
Is anything sent anywhere?
No. Encoding, decoding and parsing all happen in this tab.