Convert GIF to TXT

Converting GIF to TXT runs optical character recognition over the picture and returns what it read as a plain text file. It is built for the case that produces most GIFs with words in them — a screenshot — and the recognition happens in your browser.

  • Where it runs In your browser. The file is never uploaded.
  • Rebuilt TXT works differently from a GIF, 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.

Why the screenshot ended up as a GIF at all

Almost every GIF with readable words in it is a screen capture. Older screenshot tools defaulted to GIF, forum software converted uploads to it, wikis and bug trackers accepted it when they accepted little else, and a great many support tickets from the last twenty years have a GIF of an error dialog attached to them.

That history is why this conversion is worth having and also why it is harder than reading a scan. A screenshot saved as a GIF has been through a palette reduction that a screenshot saved as a PNG has not, and text is the content most sensitive to it.

A still GIF is supported; an animated one is a different job

The recogniser reads the file directly, and its own documented format list covers GIF for non-animated files. A screenshot, a captured dialog, a scanned page saved as a GIF: all of those are inside what it reads, and nothing on this site has to decode them first.

An animated GIF sits outside that. Rather than guess at which frame would be used or whether the file would be read at all, the honest route is one extra step: convert the GIF to a PNG, which takes the first frame, and run the PNG through this tool. If the text you want is not on the first frame, extract that frame in an image editor first.

What 256 colours does to the edges of letters

Screen text is antialiased: the edges of every glyph are drawn in intermediate shades so the strokes look smooth. A GIF has at most 256 colours to work with, and when a screenshot is reduced to that palette the intermediate shades are the first casualty — replaced by the nearest available colour, or dithered into a checkerboard of two.

Recognition works by comparing the shape of each glyph against what it has learned, and a stroke edged with alternating pixels is a different shape from a stroke edged with a smooth ramp. This is the main reason a GIF screenshot reads slightly worse than the same screenshot as PNG, and it is also why enlarging the GIF before running it through does not help: enlarging a dithered edge produces a larger dithered edge.

The file goes to the recogniser exactly as it is

Every other image conversion on this site decodes the picture to raw pixels first and works from those. This one deliberately does not — the file is handed over untouched, because the recogniser has its own loader and forcing the image through a canvas would flatten anything transparent to black.

On a scan of white paper that single detail is the difference between a readable page and a black rectangle, and it is worth knowing if your GIF has a transparent background. Because the file is passed straight through, what the recogniser sees is what the file contains, transparency and all.

Choosing the language, and what a wrong choice looks like

Four language models are available: English, German, French and Spanish. The setting is a choice rather than something detected, because detection is itself a guess and a wrong one would be invisible.

A wrong choice does not fail. It produces text — plausible-looking words, in the wrong language, mapped from shapes onto whatever vocabulary the model holds. That is the most dangerous failure mode this tool has, because everything about the output looks normal. If the result reads like a badly translated version of what you can see in the picture, the language setting is the first thing to check.

The layout is not reconstructed, and that is on purpose

What comes back is lines of text with the blank lines the recogniser saw between blocks, and no other processing at all. Nothing collapses those blanks, joins lines that look like one wrapped sentence, or rebuilds columns.

Every one of those tidying steps is a guess about layout. A poem, an address block, a code sample and a table all lose meaning when their line breaks are rearranged, and the tool has no way to tell which of those it is looking at. Leaving the breaks alone means a screenshot of a table comes back with its columns run together, which is inconvenient and recoverable — unlike a rewrapped address.

The first run pays for the engine; the rest do not

Starting the recogniser means downloading and compiling several megabytes of WebAssembly and then the language model. That is seconds of waiting before any recognition begins, and it is why this is the slowest tool on the site by a wide margin.

It happens once. The model is cached on your own machine after the first run — local storage, nothing shared — so a second GIF starts almost immediately, and a batch of twenty pays the startup cost once rather than twenty times. Switching language reloads a different model, so it is worth doing all the English files together.

What this will not read out of a GIF

Handwriting, essentially. Text at an angle, text over a busy background, text rendered so small that the strokes are one pixel wide, and text in a decorative typeface will all produce errors ranging from a few characters to complete nonsense.

The other case worth naming is a GIF that was scaled down after the screenshot was taken. Halving the size of a screenshot destroys the glyph shapes in a way no recogniser recovers, and it is extremely common because people resized images to fit forum limits. If you have any route back to the original capture, use it — this conversion cannot restore what the resize removed.

Nothing about the picture leaves your browser

The recogniser, its WebAssembly core and every language model are served from this site rather than fetched from a public CDN. That took deliberate work, because the library’s default is to fetch all three from elsewhere, and the point is not the image — the image would never have left either way — but the fact of the request.

Somebody reading a payslip, a medical letter or a private conversation out of a screenshot should not have that announced to a third party by the URL of the page they are on. The recognition happens in your browser, there is no account, and the text is never stored.

How to pull the text out of a GIF

  1. Drop the GIF onto this page, or click to choose it.
  2. Set the language the text is written in — a wrong setting produces confident nonsense.
  3. Read the result against the picture, then download it as a TXT file.

GIF and TXT: pixels of letters becoming characters

GIF compared with TXT
GIFTXT
Full nameGraphics Interchange FormatPlain Text
File extension.gif.txt, .text, .log
Media typeimage/giftext/plain
CompressionLossless — nothing is discarded
First published19871963
Published byCompuServe
SpecificationGIF89aUnicode
LicensingOpen standardOpen standard
Standing todayLegacy, still read everywhereCurrent
Bit depth8
Colour it can describeindexed palette
Largest image65,535 px per side
Opens in a browserEvery browserEvery browser
Considered insteadWebP, MP4MD, RTF

What the target format adds

TXT is a working format and GIF 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

GIF 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: GIF opens in GIMP, Adobe Photoshop and ImageMagick, TXT in Notepad, TextEdit and Visual Studio Code — so whoever receives the result needs something from the second list.

What each format is for

The two are aimed at different work: GIF at the web, TXT at moving data between programs and archiving. That is worth weighing before converting, because the reason one exists is usually the reason the other is awkward.

GIF is CompuServe'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 GIF in 1987. The older one is generally the safer file to hand to somebody; the newer one usually does the job in fewer bytes.

GIF to TXT: accuracy, languages and what it can read

Does this work on an animated GIF?

The recogniser’s own documentation lists GIF as a supported format for non-animated files, so a still GIF is squarely within what it reads and an animated one is not. If your file moves, convert the frame you want to a PNG first and run that through instead — it takes one extra step and removes the doubt.

How accurate is it?

Clean, straight, reasonably large type comes out close to perfect. A screenshot that was scaled down before it was saved, a photograph of a screen, an unusual typeface or handwriting will produce mistakes. The result is a best guess made by pattern recognition, not a transcript, so read it against the original before relying on it.

Which languages can it read?

English, German, French and Spanish. The language is a setting rather than something detected, and choosing the wrong one produces confident nonsense rather than an error — the recogniser will map the shapes onto the vocabulary it was given.

Will it keep the layout of a table?

No. What comes back is lines of text in reading order, with the blank lines the recogniser saw between blocks and no other tidying. Columns in a screenshot of a table will run together, because nothing here reconstructs a grid — the alternative would be guessing at structure, and a wrong guess is worse than plain lines.

Why is the first conversion slow?

Because it downloads and compiles several megabytes of WebAssembly and then a language model for the language you chose. That happens once: the model is cached on your own machine afterwards, so a second file starts recognising almost immediately. It is by a wide margin the slowest tool on this site.

Is the image sent to a server to be read?

No, and neither is anything else. The recogniser, its WebAssembly core and its language models are all served from this site rather than from a third-party CDN, precisely so that reading a payslip or a private message does not announce itself to anyone. The picture is processed in your browser.

More about these formats

Where these figures come from

The claims this page makes about GIF and TXT are checkable, and these are the documents that settle them.