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

The **`slice()`** method of the `Blob` interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.

## Syntax

```js
slice()
slice(start)
slice(start, end)
slice(start, end, contentType)
```

### Parameters

- `start` _**optional**_
  - : The 0-based index of the first byte to include in the new `Blob`. If negative, it refers to an index from the end of the `Blob`. The default value is 0.
- `end` _**optional**_
  - : The 0-based index of the first byte that will not be included in the new `Blob`. If negative, it refers to an index from the end of the `Blob`. The default value is `size`.
- `contentType` _**optional**_
  - : A string indicating the content type to assign to the new `Blob`. The default value is an empty string.

### Return value

A new `Blob` object containing the specified subset of data.
