I have a TAN list on paper for online banking that looks like this:

001 123456   015 123456  029 123456  043 123456 ...
002 123456   ...

I scaned it and now I want to use OCR to get the text.

I tried tesseract, gocr and cuneiform.

All programms don't get good results. How can I OCR the text?

Background: I want to store the TAN list in keepass. Keepass does support images, but only the PC version. The Android version does not. That's why I want text. And text is better since, you can use copy&paste.


2 Answers 2


The quality of the original image is often a critical resource in ocr. (try something like 600 dpi)

I would suggest you to try tesserat.

tesseract imagename outputbase [-l lang] 

(and, dealing with banking, choose very carefully what you store in your devices...)


I found this solution myself:

  1. Scan TAN list
  2. remove sequence ID with Gimp. Only TANs are left. Needed since in my case two different fonts are used, which seem to confuse the OCR
  3. gocr -C 0123456789 tans.png
  4. Rectangular select in terminal: ctrl+alt select-with-mouse
  5. copy+paste to tans.txt
  6. read-tan-list.py tans.txt.
  7. insert result to keepass or other password app.


import sys
for line in open(sys.argv[1]):
    if not line:
for i, tan in enumerate(tans):
    print('%03d %s' % (i+1, tan)),
    if i%5==4:
        print('   '),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.