---
title: "Discussion on \"URLSearchParams: Stop Encoding Your Query Values Twice\" | Hashnode"
description: "Discussion on \"URLSearchParams: Stop Encoding Your Query Values Twice\". Build JavaScript query strings without double encoding. Learn how raw values, plus signs and repeated parameters behave, with round-trip tests."
url: "https://hashnode.com/posts/urlsearchparams-stop-double-encoding-query-values/6af911a41263d2818eb4da06"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [URLSearchParams: Stop Encoding Your Query Values Twice](https://jitsumi.hashnode.dev/urlsearchparams-stop-double-encoding-query-values?utm_source=hashnode&utm_medium=feed)

Build JavaScript query strings without double encoding. Learn how raw values, plus signs and repeated parameters behave, with round-trip tests.

3h ago · 5 min read · jitsumi.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Jitsumi](https://hashnode.com/@jitsumi)

@jitsumi

  
[View profile](https://hashnode.com/@jitsumi)

Jitsumi builds small Windows utilities for familiar, everyday PC tasks.

We are a small team of developers with one goal in mind. Pushing low spec PCs to the limit.

## Responses 1

Markdown supported · ⌘↵ to post

[QRiQRa Team](https://hashnode.com/@qriqra)

[47m ago](https://hashnode.com/posts/urlsearchparams-stop-double-encoding-query-values/6af911a41263d2818eb4da06/comment/6af937278042df3c8ddac445)

The "inspect three values: raw input, serialised URL, parsed value at the handler" step is a clear way to find where meaning diverges. One related trap we would add: form submissions and URLSearchParams agree on + for spaces, but some server frameworks decode the query with plain percent-decoding and leave + as a literal plus. Your round-trip test passes in Node, yet the handler can still see "tea+cake". Adding one integration check with a value containing a space, as you suggest at the end, is the cheapest way to catch that.
