> ## Documentation Index
> Fetch the complete documentation index at: https://docs.odella.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Read Binary Block

> Read the contents of a file as binary data

<Frame>
  <img src="https://mintcdn.com/odella/PGZ7enNCqh0mvwj_/block-reference/assets/read_binary_light.png?fit=max&auto=format&n=PGZ7enNCqh0mvwj_&q=85&s=7d3dbe0e90573b8819e4528e4d832ec6" alt="Read Binary Block Screenshot" className="block dark:hidden" width="844" height="366" data-path="block-reference/assets/read_binary_light.png" />

  <img src="https://mintcdn.com/odella/PGZ7enNCqh0mvwj_/block-reference/assets/read_binary_dark.png?fit=max&auto=format&n=PGZ7enNCqh0mvwj_&q=85&s=ea2e0869256e46edf3cedf7e0da5d44c" alt="Read Binary Block Screenshot" className="hidden dark:block" width="796" height="288" data-path="block-reference/assets/read_binary_dark.png" />
</Frame>

## Overview

The Read Binary Block allows you to read the contents of a file as raw binary data. This is particularly useful when working with non-text files or when you need to process file contents in their original binary format.

## Inputs

<ParamField path="file" type="file" required>
  The input file to be read as binary. The file must have a valid media type.
</ParamField>

## Outputs

<ResponseField name="output" type="binary">
  The raw binary content of the input file as a Uint8Array.
</ResponseField>

## Editor Settings

This block does not have any configurable settings in the editor.

## Example: Reading an Image File as Binary

1. Add a Read Binary block to your flow.
2. Connect a File block containing an image file to the `file` input of the Read Binary block.
3. Run your flow. The block will output the raw binary data of the image file.

## Error Handling

* If the input file is missing or invalid, the block will return an error.
* If the file is missing a media type, the block will throw an error.
* If a FileProvider is needed to load from URL but not available, the block will throw an error.
* If there are issues reading the file (e.g., file permissions, corrupted file), the block will fail and provide error details.

<Warning>
  Be cautious when working with large files, as reading them entirely into memory as binary data may consume significant resources.
</Warning>

## FAQ

<AccordionGroup>
  <Accordion title="What types of files can I read with this block?">
    The Read Binary block can read any type of file, including text files, images, audio files, executables, and more. It treats all files as raw binary data.
  </Accordion>

  <Accordion title="How is this different from the Read File block?">
    While the Read File block is optimized for reading text files and can perform encoding conversions, the Read Binary block reads the raw binary content of any file without any interpretation or conversion.
  </Accordion>

  <Accordion title="Is there a size limit for files that can be read?">
    The block itself doesn't impose a specific size limit, but reading very large files may be limited by available memory and system resources. For extremely large files, consider using streaming or chunking approaches.
  </Accordion>
</AccordionGroup>

## See Also

* [Read File Block](/block-reference/loaders/read-text)
* [File Block](/block-reference/data/file)
* [Write Binary Block](/block-reference/io/graph-output)
