Skip to content
uencoder
TASK

Build URL query strings from objects

Construct properly encoded query strings from JavaScript objects. Handle arrays, nested objects, and special characters correctly.

  1. 1

    Building a query string requires: key=value pairs joined by &, percent-encoding of keys and values, handling of arrays (repeated keys or bracket notation), and omitting undefined/null values. The order of parameters may matter for caching and signature verification.

  2. 2
    URL Encoder →

    Percent-encode each key and value. Spaces → %20, & → %26, = → %3D, non-ASCII → UTF-8 percent-encoding. Use encodeURIComponent (not encodeURI) for query string values — it encodes all reserved characters.

  3. 3
    URL Parser →

    Verify the built URL by parsing it back. The parsed query string should match the original object. This round-trip test catches encoding errors and structural issues.

  4. 4
    url-encode → hex-encode

    Use the URL encode workflow to encode a payload object as a query string, with proper handling of nested parameters and special characters.

Frequently asked questions

Should I use encodeURIComponent or encodeURI?
Use encodeURIComponent for query string keys and values — it encodes all reserved characters (&, =, +, /, etc.). Use encodeURI for full URLs — it preserves URL structure characters (?, &, =, /). Using the wrong one causes encoding bugs.
How do I handle undefined and null?
Omit undefined and null values — they should not appear in the query string. For falsey values: 0, false, and empty string should be included as key=0, key=false, key=. Decide based on your API contract — some APIs distinguish absent vs. empty.

Workflows that solve this

Convert Base32 to Hex
Decode Base32 and re-encode as hex for debugging.
PIPELINE
Convert Base64 to Hex
Decode a Base64 string into raw bytes and re-encode it as hexadecimal for inspection or interop.
PIPELINE
Convert Binary to Hex
Decode a binary (base-2) string into its byte value and re-encode as hexadecimal.
PIPELINE
ChaCha20 Encrypt then Hex
ChaCha20 encrypt then hex-encode the ciphertext.
PIPELINE
Encode a JSON payload for URL transport
Prepare a JSON document for a URL parameter: pretty-print, Base64-encode, then percent-encode — the exact inverse of the nested-parameter decode chain.
PIPELINE
Hex encode then decode round-trip
Encode text to hexadecimal and decode it back to verify the round-trip preserves the original data.
PIPELINE
Hex-encode text and analyze
Convert text to its hexadecimal representation then compute character statistics on the hex output.
PIPELINE
Convert Multibase to Hex
Decode multibase and re-encode as plain hex.
PIPELINE
Convert Octal to Hex
Decode octal and re-encode as hex for compact representation.
PIPELINE
Punycode Decode and URL Parse
Decode Punycode domain then parse the full URL.
PIPELINE
Reverse text and show hex encoding
Reverse a string then inspect its hexadecimal representation — useful for debugging byte-order issues and encoding puzzles.
PIPELINE
SHA-512 Hash then Hex Encode
Compute SHA-512 hash then encode as hex for readability.
PIPELINE
Kebab Case and URL Encode
Convert to kebab-case then URL-encode for safe URL slugs.
PIPELINE
Decode URL and show hex bytes
Percent-decode a URL-encoded string then view its hexadecimal byte representation for low-level analysis.
PIPELINE
URL Decode and Parse
URL-decode then parse the URL into components.
PIPELINE
URL Encode then Base64 Double Encode
URL-encode then Base64-encode for double encoding in API payloads.
PIPELINE
Encode a text payload for URL transport
Percent-encode text then show its hex representation for safe URL parameter transport.
PIPELINE
XXencode then Hex
XXencode text then hex-encode the result.
PIPELINE

Learn more

Want to understand why?

Related tools