# How to Implement accepts() Correctly in MarkItDown Converters

> Learn to correctly implement MarkItDown's accepts() method for binary stream converters. This guide explains fast metadata checks and byte-peeking for efficient stream handling.

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

---

**The `accepts()` method in MarkItDown must return a boolean indicating whether a converter can handle a given binary stream, using only fast metadata checks from `StreamInfo` and optional byte-peeking with mandatory stream-position restoration.**

When extending the `microsoft/markitdown` library with custom document converters, implementing `accepts()` correctly is essential for maintaining the performance and reliability of the document processing pipeline. The core engine calls this method—defined in the abstract `DocumentConverter` class located in [`src/markitdown/_base_converter.py`](https://github.com/microsoft/markitdown/blob/main/src/markitdown/_base_converter.py)—before attempting any expensive