# When to Pass StreamInfo to MarkItDown Convert Methods: A Complete Guide

> Discover when to pass StreamInfo to MarkItDown convert methods to override file type detection for binary streams, MIME types, and unit tests.

- Repository: [Microsoft/markitdown](https://github.com/microsoft/markitdown)
- Tags: how-to-guide
- Published: 2026-04-11

---

**Pass a `StreamInfo` object to MarkItDown's convert methods whenever you need to override automatic file type detection, such as when processing raw binary streams, handling ambiguous MIME types, or ensuring deterministic behavior in unit tests.**

The `microsoft/markitdown` library automatically infers file formats using filename extensions, MIME headers, and the Magika content-type detector. However, when dealing with raw `BytesIO` objects, misleading URLs, or custom encodings, you should explicitly provide **StreamInfo** metadata to ensure the correct converter is selected. This