# Code Viewer

Free online code viewer. Open source and config files (.sh, .vue, .cpp, .toml, .rb, .swift, and more) directly in your browser without uploading them.

> Canonical page: https://elysiatools.com/en/viewers/code

- **Category:** Text Files

- **Supported formats:** .sh, .bash, .vue, .ini, .toml, .proto, .hcl, .log, .diff, .patch, .bundle, .bdl, .ipynb, .http, .react, .gv, .tex, .rb, .swift, .kt, .c, .cpp, .cc, .h, .hpp, .cs, .php

## Overview

This code viewer renders a wide range of long-tail source and configuration files locally in your browser. It covers shell scripts, Vue single-file components, C/C++ headers and sources, config formats like TOML and INI, and many more languages and markup files that do not have their own dedicated viewer. Pick a sample or choose your own file to inspect it with highlighting.

## When to use

- You have a shell, config, or less common source file and want to read it without an editor.
- You need to inspect a Vue component, C/C++ file, or script quickly.
- You are on a device without a code editor and need to browse a code or config file.

## How it works

- Select a built-in sample or choose your own code/config file.
- The viewer renders the source with syntax highlighting in the browser, with no upload.
- Inspect the file, then switch samples or load another file any time.

## Use cases

- Reviewing shell scripts, Vue components, and C/C++ sources.
- Inspecting config files like TOML, INI, and Graphviz DOT.
- Browsing long-tail languages (Ruby, Swift, Kotlin, PHP) on any device.

## Samples

- **C++ Comments**: C++ file with single-line and multi-line comments including function documentation
- **Shell Script**: A Bash script with a function, local vars, and error handling
- **Vue Component (.vue)**: A Vue 3 single-file component with script setup and reactivity
- **C++ with Templates**: A C++ example using templates, the STL, and range-based loops
- **TOML Config**: A structured TOML configuration with nested tables
- **Graphviz (.gv)**: A Graphviz DOT file describing a small directed pipeline graph
- **Standard Nginx Access Log**: Standard Nginx access log in Combined Log Format with typical GET/POST requests, various status codes, and different UserAgents
- **Access Log with Various HTTP Status Codes**: Nginx access log demonstrating comprehensive HTTP status codes across 2xx, 3xx, 4xx, and 5xx ranges for testing parser capabilities
- **Access Log with Bot and Crawler Traffic**: Nginx access log featuring various web crawlers and bots including Googlebot, Amazonbot, Bingbot, and MSNBot for bot detection testing
- **Basic Nginx Error Log**: Nginx error log with common error scenarios including directory index forbidden, upstream timeouts, and FastCGI errors in standard error format
- **Nginx Error Log - Upstream Connection Issues**: Specialized Nginx error log focusing on upstream connection problems including connection refused, premature closure, timeout issues, and no live upstreams
- **Mixed Access and Error Log (Real-World Scenario)**: Real-world scenario combining access logs and error logs interleaved, demonstrating actual production environment with normal traffic and error conditions

## Frequently asked questions

### Is this code viewer free?

Yes. It runs in your browser for free and needs no registration or installation.

### Are my files uploaded?

No. Files opened from your device stay on your device. Only public sample files come from the server.

### Which formats does it cover?

It covers long-tail code and config formats such as .sh, .vue, .ini, .toml, .proto, .log, .diff, .ipynb, .tex, .rb, .swift, .kt, .c, .cpp, .h, .hpp, .cs, and .php. Popular languages like JavaScript, TypeScript, Python, Java, SQL, Go, and CSS each have their own dedicated viewer.

## Related content

- [Markdown Viewer](https://elysiatools.com/en/viewers/md): Free online Markdown viewer. Open .md and .markdown files directly in your browser without uploading them.
- [TXT Viewer](https://elysiatools.com/en/viewers/txt): Free online TXT viewer for plain text files. Open .txt files directly in your browser without uploading them.
- [JSON Viewer](https://elysiatools.com/en/viewers/json): Free online JSON viewer. Open .json, .jsonc, and .json5 files directly in your browser without uploading them.
- [YAML Viewer](https://elysiatools.com/en/viewers/yaml): Free online YAML viewer. Open .yaml and .yml files directly in your browser without uploading them.
- [XML Viewer](https://elysiatools.com/en/viewers/xml): Free online XML viewer. Open .xml files directly in your browser without uploading them.
- [HTML Viewer](https://elysiatools.com/en/viewers/html): Free online HTML viewer. Open .html and .htm files directly in your browser without uploading them.
