Treat JSON as a data format

JSON represents objects, arrays, strings, numbers, booleans, and null. An object maps string keys to values; an array is an ordered sequence. Nesting lets a response represent records and collections together. JavaScript object-literal conveniences such as comments, single quotes, undefined, and trailing commas are not standard JSON.

When a parse error occurs, inspect the first reported area and its preceding delimiter. A missing comma before the next key can produce an error at that next key. Fix the source value rather than deleting unfamiliar characters until the parser accepts it. Keep the original input, especially when the data came from a system you need to diagnose.

{
  "project": "WebToolspire",
  "checks": ["metadata", "headings"],
  "options": { "remote": false },
  "note": null
}

Try the JSON Formatter →

Know what formatting changes

Formatting parses a value and serializes it with indentation. Minification serializes it without optional whitespace. These operations help readability or transmission size, but do not validate an API’s business rules. A syntactically valid object can still omit a required field or supply the wrong data type for its consumer.

Parsing also has representation limits. JavaScript numbers use floating-point precision, so large integer identifiers can be rounded. WebToolspire rejects unsafe integers and non-finite results; store exact large identifiers as strings. Decimal arithmetic can still show floating-point limitations. Duplicate object keys follow JSON.parse’s last-value-wins behavior, and numeric-looking keys can be reordered on serialization. Do not use a formatter as a lossless source-code archive or a financial decimal calculator.

Encode a value or a whole URI deliberately

A URL uses reserved characters as separators. In /search/?q=red&sort=name, the question mark begins a query and the ampersand separates pairs. If a user’s query value itself contains an ampersand, encode it as data so it cannot accidentally create another parameter. Percent encoding represents encoded bytes using a percent sign and hexadecimal digits.

encodeURIComponent is intended for an individual component: it encodes separators such as & and /. encodeURI preserves whole-URI syntax characters such as :, /, ?, and &. Applying encodeURI to an untrusted query value leaves separators active. Applying encodeURIComponent to a complete URL encodes the delimiters that make it a navigable URL. Neither operation proves a destination is safe to fetch.

encodeURIComponent("red & blue") // "red%20%26%20blue"
encodeURI("https://example.com/search/?q=red blue")
// "https://example.com/search/?q=red%20blue"

Try the URL Encoder / Decoder →

Preserve repeated query parameters

Form-style query encoding treats + as a space. decodeURIComponent does not: it leaves a literal plus sign alone. URLSearchParams follows form conventions, where %2B represents a literal plus. Decide which layer you are inspecting before replacing every plus sign in a string.

A query can contain the same key more than once. tag=seo&tag=code is a pair of values, not necessarily an error. Converting it directly into a plain object can overwrite one. The query tool uses an ordered array of string pairs so parsing and generation preserve duplicates. Generated URLs still need review against the receiving application’s rules.

[["tag", "seo"], ["tag", "code"], ["q", "red + blue"]]
// tag=seo&tag=code&q=red+%2B+blue

Investigate decoding failures instead of guessing

An incomplete percent escape such as %2 or invalid UTF-8 bytes can cause decoding to fail. Repeated encoding creates a different problem: an encoded percent sign becomes %25, so %252F decodes once to %2F and again to /. Each pass can change how a string will be interpreted by a later system. Decode only the layer you understand.

decodeURI intentionally preserves some encoded reserved characters, while decodeURIComponent decodes them. Use the operation that matches the intended component. Keep the original string beside the result and test a round trip for representative Unicode, spaces, ampersands, and plus signs. A successful round trip checks that transformation, not the safety or accessibility of a URL.

Keep representation changes separate from meaning

Base64 wraps bytes in a text alphabet; it does not encrypt them. Use UTF-8 when encoding text, choose the URL-safe alphabet only when the consumer expects it, and distinguish binary payloads from text. Similarly, CSV and JSON have different models: a quoted CSV cell can contain a comma or newline, while a JSON property can contain nested data. A converter needs a real quote-aware parser, a clear header policy and an explicit decision about types. Review leading zeroes, empty cells and spreadsheet formulas before importing the output.

Compare the source and transformed data when fidelity matters. A line diff can reveal changed rows, but ignore-whitespace and case-insensitive options deliberately hide some differences. A regex can inspect recurring structure, provided you use the intended engine and keep execution bounded. For numeric dates, record whether a value is Unix seconds or milliseconds; timezone formatting changes its presentation, not the instant. These checks complement JSON syntax validation rather than replacing the receiving system’s schema.

Minifying CSS or JavaScript also needs language-aware parsing. Whitespace and comment-like characters can occur inside strings, URLs, template literals and regular expressions. Use a parser/printer rather than global text replacements, preserve a source copy and test the resulting file in the application. Smaller UTF-8 source text is separate from gzip/Brotli transfer size, bundling, tree-shaking and runtime speed.

Try the CSV to JSON & JSON to CSV Converter →

Build campaign query values without changing the destination

A UTM link is still an ordinary URL. Keep source, medium and campaign names consistent, replace old UTM values rather than stacking duplicates, and retain unrelated query pairs and the fragment. A builder can construct that representation without sending a tracking event. Whether visits are measured depends on the destination’s real analytics and consent configuration. Keep private identifiers out of shared campaign fields.

For a newsletter linking to /notebooks/?color=blue#sizes, use source=newsletter, medium=email and campaign=spring_launch. The destination filter and fragment stay in place while the three campaign fields describe the visit’s origin. Use utm_content=hero_button to distinguish a second creative only when that distinction is useful. Choose a stable naming convention and review the final URL before sharing it; Newsletter and newsletter can become different report values.

Test that the tagged URL reaches the intended page and that any redirects preserve the parameters you need. Keep campaign links for external acquisition: adding them to ordinary internal navigation can confuse attribution. A destination can usually declare its clean content URL as canonical when campaign parameters leave the content unchanged; a canonical is a preference signal, not a way to repair broken routing or promise which URL a search engine selects.

https://example.com/notebooks/?color=blue&utm_source=newsletter&utm_medium=email&utm_campaign=spring_launch#sizes
  • The destination, existing query values and fragment are correct.
  • Source, medium and campaign use the agreed case and naming convention.
  • No credentials, email addresses or personal identifiers appear in campaign values.
  • Redirects and actual destination analytics are tested separately from URL generation.

Try the UTM Link Builder →

Use a small, reproducible debugging sample

Remove tokens, personal records, signed URLs, and credentials before sharing an example. WebToolspire’s JSON and URL utilities process input in browser memory and do not navigate to entered URLs. A URL copied into a ticket, history, or analytics system can still expose its query values elsewhere. Encoding is reversible representation, not encryption.

Keep an original sample, choose one operation, inspect the output, and test it against the intended consumer. Change one layer at a time: JSON string escaping and URL percent encoding solve different problems, even when both appear in the same API request.

  • Original input is retained outside the formatter.
  • JSON syntax and application schema are checked separately.
  • Exact identifiers use a representation that preserves them.
  • URL values use component encoding and preserve repeated keys.
  • Secrets are removed before copying or sharing.

References and further reading