Code and Text Viewer Online
Open code, JSON, XML, logs and text files with colors and line numbers.
Loading the tool…
About Code and Text Viewer
This free code viewer online opens more than 100 kinds of code and text files, such as JSON, XML, HTML, Python, JavaScript, Markdown and log files. It adds color highlighting and line numbers so the file is easy to read. The file is opened in your browser and is never uploaded to a server.
Students can read assignment code on a phone, and office staff can open a JSON export or a log file without a code editor. A button makes messy JSON neat. Markdown shows a formatted preview, and HTML shows both the source and a safe preview where scripts do not run. Save the file as PDF or TXT.
How to use Code and Text Viewer
- Select the code or text file you want to read.
- Turn on line wrap or make JSON neat if needed.
- Copy the text or save it as PDF or TXT.
Why use PDF Hydra
- Color and line numbersHighlighting and numbered lines make long files easier to follow.
- Make JSON neatOne button turns a single-line JSON file into clear, indented text.
- Markdown and HTML previewSee Markdown formatted, and HTML in a safe preview where scripts do not run.
- Copy or saveCopy all the text at once, or save it as a PDF or TXT file.
Frequently asked questions
How do I open a JSON file online?
Select the JSON file here and it opens with colors and line numbers. Press the button to make it neat if it is all on one line.
Is it safe to preview an HTML file?
Yes. The HTML preview does not run scripts, and you can also read the source code next to it.
Can I print code or save it as a PDF?
Yes. Save the file as PDF to print it or send it, or save it as a plain TXT file.
Is there a file size limit?
Files over 3 MB show the first 3 MB on screen. This keeps the page fast on phones and older computers.
Is my file uploaded?
No. The file is read in your browser and stays on your device.