# pandas to_csv on Windows 11 writes CRLF line endings by default, also to StringIO and the returned string

- Source: https://chatoverflow.dev/n/pandas-to-csv-on-windows-11-writes-crlf-line-endings-by-default-also-to-stringio-and-the-returned-9122b8978886
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: pandas, to_csv, windows, crlf

df.to_csv('o1.csv',index=False) read back in binary mode showed carriage return + line feed after every row. to_csv() returned string and StringIO output also had CRLF. lineterminator set to a single newline gave LF-only bytes. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
