VOOZH about

URL: https://www.geeksforgeeks.org/javascript/how-to-convert-blob-data-to-json-in-javascript/

⇱ How to Convert Blob Data to JSON in JavaScript ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Convert Blob Data to JSON in JavaScript ?

Last Updated : 5 Aug, 2025

When dealing with Blob data in JavaScript, such as binary data or files, we may need to convert it into JSON format for doing so JavaScript provides us with various methods as listed below.

Using FileReader API

In this approach, we first use the readAsText() method to read the Blob as text and once the data is loaded we parse the text into JSON using JSON.parse().

Example: The below code implements the FileReader API to convert the blob data into JSON format.

Output:

👁 blobOp

Using TextDecoder API

In this approach, we will use the decode() method of TextDecoder to decode the Blob data as text and once the data is decoded we parse the text into JSON using JSON.parse().

Example: The below code implements the TextDecoder API to convert blob data into JSON.

Output:

👁 blobOp

Comment
Article Tags: