Dos2Unix / Unix2Dos - Text file format converters

Convert text files with DOS or Mac line endings to Unix line endings and vice versa.

This is an update of Benjamin Lin's implementations of dos2unix and unix2dos. Benjamin Lin's implementations of dos2unix and unix2dos were distributed via (later, now ibiblio) and became part of several Linux distributions such as RedHat, Suse, Gentoo, and others. This update includes all RedHat patches and fixes several other problems. Internationalization has been added and ports to DOS, Windows, Cygwin and OS/2 Warp have been made.

These implementations of dos2unix and unix2dos have been modelled after dos2unix/unix2dos under SunOS/Solaris. The first versions were made by John Birchfield in 1989, and in 1995 rewritten from scratch by Benjamin Lin. Mac to Unix conversion was added by Bernd Johannes Wuebben in 1998, Unix to Mac conversion by Erwin Waterlander in 2010.

In 2010 the two separate dos2unix and unix2dos packages have been bundled into a single dos2unix package (version 5.0). Support for Unicode UTF-16 was added in 2012 (version 6.0). Version 7.0, in 2014, was a major code cleanup and added a test suite.

Features Dos2Unix includes:
dos2unix - DOS/MAC to UNIX text file format converter
unix2dos - UNIX to DOS/MAC text file format converter


NEWS.txt Basic change log.
ChangeLog.txt. Detailed change log.
DONATE.html If you want to give something back.


Project home page :
SourceForge project page :

Latest development version from Git repository:

git clone git://
Browse the code here

Check the files out as-is (no line break conversion), otherwise tests will fail.


Erwin Waterlander