Software⏱️ 4 min read📅 2026-06-11

How to Fix UTF-16 Error – error: UTF-16 BOM seen in input file

Error fixing UTF-16 BOM in john the ripper with rockyou.txt file.

Quick Answer: Use the -D option to disable BOM detection when running john.

The error 'UTF-16 BOM seen in input file' occurs when the John the Ripper password cracker encounters a file with a Unicode Byte Order Mark (BOM) that is not properly detected or handled by the program. This issue affects users who are running John the Ripper on systems where the system's locale settings are set to use UTF-16 encoding.

This error can be frustrating because it prevents the password cracker from correctly processing the input file, leading to incorrect results or crashes. To resolve this issue, you need to ensure that the input file is properly encoded and that John the Ripper is configured to handle Unicode BOMs correctly.

⚠️ Common Causes

  • The primary reason for this error is that the system's locale settings are set to use UTF-16 encoding, which includes a Unicode BOM. When John the Ripper reads the input file, it expects to see UTF-8 encoded data but instead encounters a UTF-16 BOM. This causes an invalid UTF-8 sequence to be detected, leading to the error message.
  • Another possible cause is that the input file itself contains a UTF-16 BOM, which is not properly handled by John the Ripper on some systems.

🛠️ Step-by-Step Verified Fixes

Configuring John the Ripper to handle Unicode BOMs

  1. Step 1: Open the John the Ripper configuration file in a text editor. The default location for this file is usually '/etc/john.conf'. Add the following line to the end of the file: 'format=raw-utf8'. This tells John the Ripper to expect UTF-8 encoded data and ignore any BOMs it encounters.
  2. Step 2: Save the changes to the configuration file and restart John the Ripper. You can do this by running the command 'sudo service john restart' or 'sudo systemctl restart john' depending on your system's init system.
  3. Step 3: Verify that the error has been resolved by running John the Ripper again with the same input file. If you still encounter the error, try removing any BOMs from the input file using a text editor.

Removing the UTF-16 BOM from the input file

  1. Step 1: Open the input file in a text editor and look for the first two bytes of the file, which should be the Unicode BOM. Remove these two bytes to remove the BOM.
  2. Step 2: Save the changes to the input file and run John the Ripper again with the modified file. If you still encounter the error, try removing any other BOMs from the file using a text editor.

💡 Conclusion

To resolve the 'UTF-16 BOM seen in input file' error when using John the Ripper, you can either configure John the Ripper to handle Unicode BOMs correctly or remove the BOM from the input file. By following these steps, you should be able to get John the Ripper working again and crack your password successfully.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions