Convert BMP to TXT

Converting BMP to TXT is optical character recognition: the bitmap is read by a recogniser that decides which shapes are which letters, and the TXT file is what it concluded. It is a best guess rather than a transcript, and both the reading and the engine stay on your own machine.

  • Where it runs In your browser. The file is never uploaded.
  • Rebuilt TXT works differently from a BMP, so this is not the gradual degradation a lossy codec applies. What TXT can express is reproduced faithfully; what it has no equivalent for does not survive at all.
  • File size limit Up to 100 MB per file, free, without an account.
  • Worth knowing The text is read by pattern recognition, so it is a best guess and not a transcript. Clean, straight, well-lit type at a decent resolution comes out close to perfect; a photograph taken at an angle, a faint fax, an unusual typeface or handwriting will produce mistakes. Always read the result against the original before relying on it. The language setting matters — text read with the wrong one comes back as confident nonsense rather than as an error.

Up to 100 files at once. Mixed formats are fine.

A page stored as a bitmap is somebody’s legacy system

Nobody scans to BMP on purpose today. The files that arrive here were written by a scanner driver from the 1990s, a fax gateway, a multifunction device with an old firmware, or a Windows document system that has been running quietly in a records office for twenty years. Microsoft published the format in 1987 and the 40-byte header those files carry in 1990; the registry marks it legacy and the archives it produced are still there.

That shapes the job. This is rarely one page and a question — it is a directory, or a share, or an export from a system being decommissioned, and the words have to come out because the system that could read them is going away. It also means nobody can go back and re-scan, which is the difference between this page and every other OCR page on the site: a photograph can be retaken and a screenshot can be taken again at a larger size, but a 1997 fax of a signed letter is as good as it will ever be.

The bitmap tells you what the scan was

Because a BMP costs three bytes per pixel with no compression, its size is arithmetic and it works backwards. An A4 page scanned at 300 dpi is 2,480 by 3,508 pixels and about 26 MB. The same page at 150 dpi is 1,240 by 1,754 and about 6.5 MB. A file measured in hundreds of kilobytes was scanned at a resolution too low to read reliably.

That is a useful thing to check before converting an archive rather than after. Resolution is the single strongest predictor of how the recognition will go, it is fixed at the moment of scanning, and with a BMP you can read it off the file size without opening anything. Sorting the directory by size is therefore a rough sort by how well the recognition will go, which is an unusually cheap piece of triage — and one that only works because the format compresses nothing, so nothing about the content interferes with the number.

Black-and-white bitmaps have already lost the strokes

A great deal of legacy scanning was bilevel: every pixel forced to pure black or pure white at scan time, because a page stored one bit per pixel took an eighth of the space and disk space was the constraint. Fax images are the same by definition.

The recogniser wants the grey. Anti-aliased edges and partial strokes are what let it distinguish an e from a c, and thresholding removed them before the file existed — thin serifs vanish, faint type breaks into fragments, and bold text bleeds into a blob. Nothing recovers it, and no setting on this page compensates. If the paper still exists, re-scanning in greyscale at 300 dpi is worth more than any amount of processing. There is one small consolation: a bilevel A4 page at 300 dpi is about 1.1 MB rather than 26, so an archive of them is a fraction of the size an archive of colour scans would have been, which is exactly why it was scanned that way.

Naming and order when the archive comes back as text

Each result keeps the original filename with the extension changed, so the order of the text files is the order of the bitmaps — which is whatever the imaging system decided in 1998. Names like SCAN0001 through SCAN0912 sort correctly; names ending in unpadded numbers do not, and a set that runs to page 10 will sort it directly after page 1.

The failure mode to watch for is the quiet one. A page the recogniser found nothing on comes back as an empty file rather than as an error, so a blank separator sheet, a page scanned upside down and a page whose contrast defeated it all look identical in the output directory. Sorting the results by size and opening the smallest few takes a minute and finds every one of them.

Choose the language before the bitmap is read

English, German, French and Spanish have models here, and the choice is not a hint. The recogniser matches shapes against the letterforms and the vocabulary of one language, and given the wrong one it does not fail — it returns the closest match within a set that does not contain the right answer.

The symptom is text that is fluent and wrong: German umlauts mangled, French accents dropped, words that nearly exist. On an archive this is worth getting right on the first file rather than the hundredth, because a batch read in the wrong language produces a directory of plausible output that nobody notices is broken until much later.

The recogniser cannot flag its own mistakes

This is the only engine on the site that can be confidently wrong rather than merely imperfect. A converter that turns a bitmap into a PNG either works or throws; this one returns text that looks exactly like text whether or not it says what the page said, with no marker on the parts it was unsure about.

Read the output against the original, and read the numbers first. A misread digit in an invoice total, an account reference or a date is precisely the error that survives a quick scan of the result and causes a real problem months later. Digits are also the worst case for recognition, because there is no vocabulary behind them — a wrong letter usually produces a word that is not a word, and a wrong digit produces a perfectly plausible number. On an archive, spot-checking one page in twenty is the minimum that makes the output usable as evidence of anything, and keeping the bitmaps is what makes it correctable later.

What comes out is words, not the document

Plain text: no headings, no columns, no tables, no positions on the page. A single-column letter or memo comes back in order and reads properly, which covers a good deal of what sits in a records archive.

Anything structured degrades. A two-column page can return with the columns interleaved, because the recogniser reads across lines that look like lines. A form loses the connection between a label and the value next to it, and a table becomes a run of numbers with no indication of which column they came from. For those, expect to do work on the result or to handle them page by page.

The engine is served from this site, not from a CDN

Tesseract normally fetches three things from a third-party CDN: its worker script, its WebAssembly core and the language model. Left as it comes, that is three requests to somebody else carrying your address and the URL of the page you are on — on a site whose entire claim is that the document is nobody else’s business.

All three are served from this origin instead, and a test fails if a CDN URL ever reappears. The bitmap itself was never going anywhere either way; the point is that a person reading a payslip or a medical record should not have the fact of it announced to a third party as a side effect of the tooling.

Reading an archive of bitmaps, a folder at a time

Drop the folder. Each file is recognised in turn and the results come back together, keeping the original filenames with the extension changed. The engine is started once for the language you chose and kept between files, so a batch of forty pays the several-second startup once rather than forty times.

It is still the slowest thing on this site by a wide margin, and the 100 MB per-file ceiling — about 33 megapixels of bitmap — is not the constraint. Time is. Start a large archive, leave it, and check the first few results before you leave it: an hour of recognition in the wrong language is an hour spent twice.

When the answer is not this page

If the scans are legible but the deliverable is a document rather than a transcript, converting the bitmaps to PDF and keeping the images is usually what the recipient actually wanted — the text extraction only matters if somebody has to search or re-use the words.

And if the recognition comes back poor on the first few pages, the honest conclusion is often that the archive is not good enough to read automatically. A 200 dpi bilevel fax of a carbon copy has a ceiling that no tool clears. Knowing that after five pages instead of five hundred is the most useful thing this page can offer.

How to read the text out of a scanned BMP

  1. Check the file size to see what resolution the page was scanned at.
  2. Drop the bitmaps here and set the language before converting.
  3. Read the first few results against the originals, especially the numbers.

BMP and TXT: a bitmap of a page turned into characters

BMP compared with TXT
BMPTXT
Full nameWindows BitmapPlain Text
File extension.bmp, .dib.txt, .text, .log
Media typeimage/bmptext/plain
CompressionUncompressed
First published19871963
Published byMicrosoft
SpecificationUnicode
LicensingPublished, not standardisedOpen standard
Standing todayLegacy, still read everywhereCurrent
Bit depth8
Colour it can describeRGB, indexed palette
Opens in a browserEvery browserEvery browser
Considered insteadPNG, TIFFMD, RTF

What the target format adds

TXT is a working format and BMP is a finished one. What comes back is editable text and objects rather than a picture of a page, which is usually the reason for the conversion and also where its limits are.

Opening the result

BMP dates from 1987 and is largely superseded. TXT is what current software writes, so the conversion is as much about staying readable as about the file itself.

The usual programs do not overlap: BMP opens in Microsoft Paint, GIMP and IrfanView, TXT in Notepad, TextEdit and Visual Studio Code — so whoever receives the result needs something from the second list.

What each format is for

BMP is Microsoft's format, published in 1987. It records 8 bits per channel.

TXT dates from 1963, specified as Unicode. Notepad, TextEdit and Visual Studio Code all read it.

TXT was published in 1963 and BMP in 1987. The older one is generally the safer file to hand to somebody; the newer one usually does the job in fewer bytes.

BMP to TXT: accuracy, bilevel scans and languages

Are my BMP files uploaded anywhere?

No. This conversion runs entirely inside your browser, so the file never leaves your device. You can confirm it yourself: open the network tab of your browser's developer tools and convert something. You will see the page load, plus the analytics and advertising the site is paid for with — and nothing carrying your file. The engine behind this particular pair is Tesseract, the open-source text recognition engine; your browser fetches it once and caches it.

How accurate is OCR on a bitmap scan?

It depends on the scan, not on the format. A clean 300 dpi grey or colour scan of printed type comes out close to perfect. A 200 dpi black-and-white fax image with broken strokes produces mistakes on every line, and nothing in the conversion can repair it.

Why do I get errors on a black-and-white scan?

Because a bilevel scan has already thrown away the information the recogniser needs. Every pixel was forced to pure black or pure white at scan time, so thin strokes and faint type disappeared before the file was written. Re-scanning in greyscale fixes it; processing afterwards does not.

Does the layout of the page survive?

No. You get the words as plain text — no columns, no tables, no headings, no positions. A single-column letter reads correctly; a two-column page can come back with the columns interleaved, and a form loses which value belonged to which label.

Which languages can it read?

English, German, French and Spanish, and the setting matters more than people expect. Text read with the wrong language comes back as confident nonsense rather than as an error, because the recogniser is matching shapes against the wrong vocabulary.

Can I convert a whole folder of scans?

Yes, and it is the normal case here. Each file is read in turn and the results come back together. Recognition is the slowest operation on this site, so a large archive is something to start and come back to.

Is anything sent to a server?

No, and unusually for OCR that includes the engine. Tesseract normally fetches its worker, its WebAssembly core and its language model from a third-party CDN; all three are served from this site instead, so no request goes out carrying the fact that you are reading a document.

More about these formats