Data Format Conversions

Shell to TXT Converter

Turn Shell source code into a clean plain-text (.txt) file: optionally remove comments without touching strings, heredocs, tidy whitespace, expand tabs and add line numbers for printing, sharing or uploading where code files are not accepted.
Runs in your browserLive result

Workspace

Options

Understands Shell strings.

How to use this tool

  1. 1Open a .sh file or paste Shell code.
  2. 2Choose the clean-up options: comments, blank lines, tabs, line numbers.
  3. 3Check the result on the right.
  4. 4Download the .txt file.

Frequently asked questions

No. The comment remover reads Shell strings properly, so text such as "http://…" or "/* … */" inside quotes is kept. Only real comments are removed, and lines that contained nothing but a comment disappear.

No. # only starts a comment at the start of a word, as in Bash, so $#, ${#var} and a#b are kept. Heredoc contents are copied unchanged.

Many forms, learning platforms, email filters and chat tools reject code files but accept .txt. Plain text with line numbers is also easier to print, review or paste into a document.

LF works everywhere on macOS, Linux and the web. Choose CRLF only if the file will be opened in old Windows tools such as Notepad on Windows 7.

No. The conversion runs in your browser with JavaScript. Your file or pasted text is not uploaded, logged or stored by MuhammadLab.