---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Blob()

The **`Blob()`** constructor creates a `Blob` object, which represents a file-like object of immutable, raw data.

## Syntax

```js
new Blob()
new Blob(array)
new Blob(array, options)
```

> **Note:** `Blob()` can only be constructed with `new`. Attempting to call it without `new` throws a `TypeError`.

### Parameters

- `array` _**optional**_

  - : An array of values to include in the `Blob`. These can be [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx), [`Blob`](../../globals/Blob/Blob.mdx), or strings. If any of these elements is a [`Blob`](../../globals/Blob/Blob.mdx), its content (and not the object itself) is copied into the Blob being constructed.

- `options` _**optional**_

  - : An object containing optional attributes for the `Blob`.
    - `type`
      - : A string indicating the MIME type of the data. The default value is the empty string `""`.
    - `endings`
      - : A string indicating how to handle line endings in the data. This can be either `"transparent"` (default) to keep line endings unchanged, or `"native"` to convert line endings to the platform's native line endings (e.g., `\r\n` on Windows).

### Return value

A new `Blob` object containing the specified data.

## Description

`Blob` objects represent data that isn't necessarily in a JavaScript-native format. The `File` interface is based on `Blob`, inheriting its functionality and expanding it to support files on the user's system.

To construct a `Blob` from other non-blob objects and data, use the `Blob()` constructor. To create a blob that contains a subset of another blob's data, use the [`slice()`](../../globals/Blob/prototype/slice.mdx) method.

The `type` property of a `Blob` object will match the MIME type specified in the constructor's `options` parameter, defaulting to an empty string if not specified.
