Compact URL builder

Path segments

Escaping /^\.{1,2}$/is possible, but it is better avoid making it first in the path segments. (e.g. prefixing with ~)

Querystring

Looking to encode Numbers, Arrays, and Objects? See /encoder.html.

  • Key
    Value

Fragment (hash)

Generated URL

makeUrl function, using basic string concatenation.

Parsed URL

parseUrl function, based on WHATWG URL constructor's properties

Parsed and validated with decodeURIComponent

Path segments (pathname)

Querystring (search)

Looping through URL.searchPararms

Fragment (hash)