Is there a free text to pdf converter that works offline?

I need to turn plain text files into PDFs on a laptop where the Wi-Fi is unreliable. Is there a free way to do that entirely offline?

Honestly, the simplest way is just opening the file and using Print to PDF. Both Windows and Mac have that built right in completely offline, so you dont even need to download any new software for it.

Yes. LibreOffice Writer is free and works fully offline: open or paste the text, then choose File > Export as PDF. On Windows, you can also open the file in WordPad or a browser and use the system “Print to PDF” option, provided the PDF printer is already installed.

I open text files in LibreOffice Writer and export to PDF, which works entirely offline. I learned this the hard way with permission slips when wifi dropped. What laptop are you on?