# read

Source: /xlsx-format/api-reference/functions/read

Read a spreadsheet from an in-memory data source.

Supports XLSX (ZIP), CSV, and HTML input. For string input with type "string",
auto-detects HTML (starts with "<") vs CSV.

```ts
read(data: any, opts?: FullReadOptions): Promise<WorkBook>
read(data: any, opts: BookSheetsAndPropsReadOptions): Promise<BookSheetsAndPropsResult>
read(data: any, opts: BookSheetsReadOptions): Promise<BookSheetsResult>
read(data: any, opts: BookPropsReadOptions): Promise<BookPropsResult>
read(data: any, opts?: ReadOptions): Promise<ReadResult>
```

## Overload

```ts
read(data: any, opts?: FullReadOptions): Promise<WorkBook>
```

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| ` data ` | ` any ` | Yes | File contents as Uint8Array, ArrayBuffer, Buffer, base64 string, binary string, or plain text string |
| ` opts ` | ` FullReadOptions ` | No | Read options controlling parsing behavior |

### Returns

` Promise< `[` WorkBook `](</xlsx-format/api-reference/interfaces/workbook/>)` > `

A full workbook, or the metadata-only shape selected by bookSheets and bookProps

## Overload

```ts
read(data: any, opts: BookSheetsAndPropsReadOptions): Promise<BookSheetsAndPropsResult>
```

### Parameters

| Name | Type | Required |
| --- | --- | --- |
| ` data ` | ` any ` | Yes |
| ` opts ` | ` BookSheetsAndPropsReadOptions ` | Yes |

### Returns

` Promise< `[` BookSheetsAndPropsResult `](</xlsx-format/api-reference/interfaces/booksheetsandpropsresult/>)` > `

## Overload

```ts
read(data: any, opts: BookSheetsReadOptions): Promise<BookSheetsResult>
```

### Parameters

| Name | Type | Required |
| --- | --- | --- |
| ` data ` | ` any ` | Yes |
| ` opts ` | ` BookSheetsReadOptions ` | Yes |

### Returns

` Promise< `[` BookSheetsResult `](</xlsx-format/api-reference/interfaces/booksheetsresult/>)` > `

## Overload

```ts
read(data: any, opts: BookPropsReadOptions): Promise<BookPropsResult>
```

### Parameters

| Name | Type | Required |
| --- | --- | --- |
| ` data ` | ` any ` | Yes |
| ` opts ` | ` BookPropsReadOptions ` | Yes |

### Returns

` Promise< `[` BookPropsResult `](</xlsx-format/api-reference/interfaces/bookpropsresult/>)` > `

## Overload

```ts
read(data: any, opts?: ReadOptions): Promise<ReadResult>
```

### Parameters

| Name | Type | Required |
| --- | --- | --- |
| ` data ` | ` any ` | Yes |
| ` opts ` | [` ReadOptions `](</xlsx-format/api-reference/interfaces/readoptions/>) | No |

### Returns

` Promise< `[` ReadResult `](</xlsx-format/api-reference/types/readresult/>)` > `
