You could a reviver function of JSON.parse and convert numerical values to numbers.

Using the reviver parameter

If a reviver is specified, the value computed by parsing is transformed before being returned. Specifically, the computed value and all its properties (beginning with the most nested properties and proceeding to the original value itself) are individually run through the reviver. Then it is called, with the object containing the property being processed as this, and with the property name as a string, and the property value as arguments. If the reviver function returns undefined (or returns no value, for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value.

If the reviver only transforms some values and not others, be certain to return all untransformed values as-is, otherwise they will be deleted from the resulting object.

var json = '[{"key":"Idle Time","values":[{"x":"SADSA","y":"4.0"},{"x":"FDDG","y":"6.0"},{"x":"FF","y":"4.15"}]},{"key":"Operational Time","values":[{"x":"SADSA","y":"20.0"},{"x":"FDDG","y":"18.0"},{"x":"FF","y":"19.45"}]}]',
    data = JSON.parse(json, (key, value) => !isNaN(value) ? +value : value);
    
console.log(data);
.as-console-wrapper { max-height: 100% !important; top: 0; }
Run code snippetEdit code snippet Hide Results Copy to answer Expand

Answer from Nina Scholz on Stack Overflow
🌐
JSON Formatter
jsonformatter.org β€Ί string-to-json-converter
String to JSON Converter online to convert JSON string to JSON
This String to JSON Convertert provide more functionality that it's competitors with powerful JSON IDE. Best and Secure Online String to JSON Online works well in Windows, Mac, Linux, Chrome, Firefox, Safari, and Edge.
🌐
Json Parser Online
json.parser.online.fr
Json Parser Online
Analyze your JSON string as you type with an online Javascript parser, featuring tree view and syntax highlighting. Processing is done locally: no data send to server.
🌐
Code Beautify
codebeautify.org β€Ί string-to-json-online
String to JSON Online to convert JSON Text to JSON Tree.
Users can also String data by uploading the file. Text to JSON works well on Windows, MAC, Linux, Chrome, Firefox, Edge, and Safari. This online json string parser helps a developer who works to JSON String data as easy to parse and understand.
People also ask

Does the String to JSON converter validate JSON?
Yes, the tool validates the JSON structure and may return errors for invalid input.
🌐
databeautifier.com
databeautifier.com β€Ί string-to-json-convertor
String to JSON Converter – Free Online Tool
What does the String to JSON converter do?
The String to JSON converter transforms plain text strings into structured JSON format.
🌐
databeautifier.com
databeautifier.com β€Ί string-to-json-convertor
String to JSON Converter – Free Online Tool
Is the String to JSON converter beginner-friendly?
Yes, the tool is easy to use and suitable for beginners as well as experienced developers.
🌐
databeautifier.com
databeautifier.com β€Ί string-to-json-convertor
String to JSON Converter – Free Online Tool
🌐
Jsontostring
jsontostring.com
Convert JSON to String Online
Our JSON to String Converter tool is responsible for extracting all the string values from the JSON which means JavaScript Object Notation file.
🌐
Online String Tools
onlinestringtools.com β€Ί json-stringify-string
JSON Stringify a String – Online String Tools
Simple, free and easy to use online tool that JSON stringifies a string. No intrusive ads, popups or nonsense, just a string stringifier. Load a string, get a JSON string.
🌐
DataBeautifier
databeautifier.com β€Ί string-to-json-convertor
String to JSON Converter – Free Online Tool
As the Best String to JSON Convertor, the tool supports complex text structures, nested objects, arrays, and key-value pairs, making it versatile for a variety of professional and educational use cases. Whether you are converting strings for debugging, testing APIs, preparing data for applications, or learning data serialization, this Best Online String to JSON Convertor provides a professional, efficient, and reliable solution.
🌐
JSONLint
jsonlint.com β€Ί json-stringify
JSON Stringify - Escape JSON for Embedding | JSONLint
Convert JSON to an escaped string for embedding in code, databases, or other JSON. Handles quotes, newlines, and special characters.
Find elsewhere
🌐
JSON Formatter
jsonformatter.org
Best JSON Formatter and JSON Validator: Online JSON Formatter
Online JSON Formatter / Beautifier and JSON Validator will format JSON data, and helps to validate, convert JSON to XML, JSON to CSV. Save and Share JSON
Top answer
1 of 3
2

You could a reviver function of JSON.parse and convert numerical values to numbers.

Using the reviver parameter

If a reviver is specified, the value computed by parsing is transformed before being returned. Specifically, the computed value and all its properties (beginning with the most nested properties and proceeding to the original value itself) are individually run through the reviver. Then it is called, with the object containing the property being processed as this, and with the property name as a string, and the property value as arguments. If the reviver function returns undefined (or returns no value, for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value.

If the reviver only transforms some values and not others, be certain to return all untransformed values as-is, otherwise they will be deleted from the resulting object.

var json = '[{"key":"Idle Time","values":[{"x":"SADSA","y":"4.0"},{"x":"FDDG","y":"6.0"},{"x":"FF","y":"4.15"}]},{"key":"Operational Time","values":[{"x":"SADSA","y":"20.0"},{"x":"FDDG","y":"18.0"},{"x":"FF","y":"19.45"}]}]',
    data = JSON.parse(json, (key, value) => !isNaN(value) ? +value : value);
    
console.log(data);
.as-console-wrapper { max-height: 100% !important; top: 0; }
Run code snippetEdit code snippet Hide Results Copy to answer Expand

2 of 3
1

The following code can also work for you:

var strJson = '[{"key":"Idle Time","values":[{"x":"SADSA","y":"4.0"},{"x":"FDDG","y":"6.0"},{"x":"FF","y":"4.15"}]},{"key":"Operational Time","values":[{"x":"SADSA","y":"20.0"},{"x":"FDDG","y":"18.0"},{"x":"FF","y":"19.45"}]}]';
var parsedJSON = JSON.parse(strJson); 
var res = [];
parsedJSON.forEach((obj) => {
  obj.values.forEach((innerObj) => {
    innerObj.y = parseFloat(innerObj.y);
  });
  res.push(obj);
});
console.log(res);
Run code snippetEdit code snippet Hide Results Copy to answer Expand

🌐
Dadroit
dadroit.com β€Ί online string to json converter
Online String to JSON Converter
Primarily used in web APIs and ... String to JSON, visit the tool address, input your String data β€”or load your String fileβ€” and the tool will display the corresponding JSON output in real time....
🌐
JSON Formatter
jsonformatter.org β€Ί json-stringify-online
JSON Stringify Online using JSON.Stringify()
JSON Stringify Online is very unique tool for convert JOSN to String and allows to download, save, share and print JSON to TSV data..
🌐
Data.Page
data.page β€Ί json β€Ί csv
JSON to CSV Converter
Convert JSON to CSV online in seconds. Paste or upload JSON, then download a clean CSV file (for Excel).
🌐
curl
curl.se β€Ί docs β€Ί manpage.html
curl - How To Use
When expanding variables, curl supports a set of functions that can make the variable contents more convenient to use. It can trim leading and trailing white space with "trim", output the contents as a JSON quoted string with "json", URL encode the string with "url", base64 encode it with "b64" and base64 decode it with "64dec".
🌐
QuickType
quicktype.io
quicktype
Millions of developers have used quicktype to generate ten billion lines of typesafe models, serializers, and validators from JSON, JSON Schema, and GraphQL in TypeScript, Python, Swift, C#, Go, Rust, Kotlin, Java, C++, Zod and more. Use it in the browser, from the command line, or give it ...
🌐
JSONLint
jsonlint.com
JSONLint - The JSON Validator
It's an excellent way to correct errors without wasting hours finding a missing coma somewhere inside your code. JSONLint is an online editor, validator, and formatting tool for JSON, which allows you to directly type your code, copy and paste it, or input a URL containing your code.
🌐
Clickbait
clickbait.wiki β€Ί projects β€Ί string_to_json.html
Text to JSON String Converter
Convert any text to a properly formatted JSON string. Free online tool for developers and data engineers.
🌐
GitHub
github.com β€Ί nlohmann β€Ί json
GitHub - nlohmann/json: JSON for Modern C++ Β· GitHub
Non-member functions: operator<<, operator>>, to_string ... Here are some examples to give you an idea how to use the class. ... β†’ Check the documentation β†’ Browse the standalone example files β†’ Read the full API Documentation with self-contained examples for every function Β· The json class provides an API for manipulating a JSON value.
🌐
Wikipedia
en.wikipedia.org β€Ί wiki β€Ί JSON
JSON - Wikipedia
2 weeks ago - Although Crockford originally asserted ... valid JSON documents that are not valid JavaScript; JSON allows the Unicode line terminators U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR to appear unescaped in quoted strings, while ECMAScript 2018 and older do not....
🌐
Text-Utils
text-utils.com β€Ί json formatter
JSON Formatter & JSON To One Line - Online Formatters | Text-Utils.com
September 6, 2025 - This Online JSON Formatter tool can be used to convert JSON to one line or format it using a specified level of indentation.