ComfyToolkit

URL Parser / Encoder

Parse, edit and encode URLs and query strings.

Input
Output

URL Encoder and Decoder

Percent-encode a value so it can travel inside a URL, or decode one you have received. This page opens in encode mode.

The distinction that matters is whether you are encoding a single value or a whole URL, because the two escape different characters and picking wrong is the classic source of broken redirect links.

Component versus whole URL

A redirect target is the case that catches everyone: it is a URL, but as a parameter value it must be component-encoded, or its own query string merges into the outer one.

  • Encode component - escapes the delimiters too, including & = ? / and #. This is what a single parameter value needs.
  • Encode URL - leaves delimiters intact because it is meant for a complete URL. Applying it to a value lets an embedded & split your query string into extra parameters.
  • Decode component and decode URL - the matching inverses.

Plus signs and spaces

Form encoding writes a space as +, while percent-encoding writes it as %20. Decode with the wrong convention and a literal plus becomes a space, or a space stays a plus. If a value arrived from a submitted HTML form, expect the plus convention.

Double encoding

Encoding an already-encoded value escapes its percent signs, so %20 becomes %2520. When you see that pattern, something in the chain is encoding twice - usually a framework that already handled it. Decode back to a clean value and encode exactly once.

Reserved characters differ by position

A character can be legal in one part of a URL and reserved in another. A question mark inside a path segment must be escaped; the one introducing the query must not be. A slash separates path segments but is ordinary data inside a parameter value.

This is why one universal escaping rule does not exist, and why the component and whole-URL variants are separate operations.

Open the full URL Parser / Encoder