Javascript Object to String
This tool converts JavaScript objects into URL-friendly query strings. It's great for building GET request URLs, tracking parameters, and encoding data dynamically for frontend or backend use.
This tool converts JavaScript objects into URL-friendly query strings. It's great for building GET request URLs, tracking parameters, and encoding data dynamically for frontend or backend use.
This free online tool helps developers convert JavaScript objects into properly encoded URL query strings. It's useful for working with APIs, forms, and web requests.
Input:
{ name: "Alice", age: 25, city: "Delhi" }
Output:
name=Alice&age=25&city=Delhi
A query string is the part of a URL after the question mark, made of name=value pairs joined by ampersands. Characters outside the unreserved set must be percent-encoded, and this tool relies on the browser's URLSearchParams to do that. In this form encoding, a space becomes a plus sign, and characters such as & or = inside a value become percent sequences like %26 and %3D. So an object with the property q set to rock & roll produces q=rock+%26+roll. Property order follows your object, and unquoted keys and single quotes are accepted.
Arrays and nested objects have no official query-string representation, and conventions differ between frameworks. This tool repeats the key for every array item, so tags: ['a', 'b'] gives tags=a&tags=b, which most servers read as a list. It does not use bracket notation such as tags[]=a. A nested object is not expanded; its value becomes the text [object Object], so flatten such data first. Values like null and true are written as the words null and true, which a server will receive as strings.
No, everything happens in your browser for full privacy.
The tool will show an error if your input isn't valid JSON/JS object syntax.
Basic support is available, but flattening deeply nested objects is limited.
URLSearchParams follows the form-encoding rules used by HTML forms, where a space is written as +. Servers decode both + and %20 as a space inside query strings.
They are converted to plain text, so null becomes the word null and true becomes the word true. The receiving server sees them as strings and must interpret them itself.