Code Line Counter — LOC Statistics
Count total, code, comment, and blank lines in source code with a visual code ratio bar chart.
How it works
- 1Paste or type your text in the input field
- 2Click "Count Lines" — processing happens in your browser
- 3Copy the result or download as a text file
What to do next
About Code Line Counter
Code Line Counter is the kind of utility you bookmark and reach for when you need it. Count total, code, comment, and blank lines in source code with a visual code ratio bar chart. It loads quickly, works on any modern browser, and produces a result you can download or copy in a single click.
Code Line Counter is shaped around the recurring needs of two audiences: engineers debugging API payloads, who use it as a quick utility between bigger tools, and backend developers inspecting requests, who use it as their primary way of getting the job done. Both groups get the same defaults and the same speed.
Code Line Counter is shaped for the gap between "I'll do it by hand" and "I'll script it." When the job is small enough that automating it would take longer than doing it, but annoying enough to want a focused tool — that is the situation this page is built for.
The processing pipeline is straightforward: your input is parsed by standard browser APIs, transformed according to the options you select, and serialised back into a downloadable result. The 0 MB per-file ceiling matches what a typical browser tab can handle without paging to disk.
Because everything runs in the page, the tool scales the same way for one user or a million — there is no per-user backend cost. The page is static, the engine is the same JavaScript bundle for every visitor, and the work happens on the visitor's own device. That keeps the tool free and keeps it fast on the first interaction.
As a workflow component, Code Line Counter is the part you reach for when a single, well-defined developer utility step needs to happen. It performs that step and returns a standard file you can carry into the next part of your pipeline.
The hard constraints are easy to remember. Maximum input: 0 MB. Multiple files per run: no — one input at a time, by design, to keep results predictable. The same controls apply on every run.
The transformation in Code Line Counter is deterministic — the same input plus the same options produces the same result every run. That predictability matters when the result has to match an upstream specification or be reproducible later.
When the job finishes, Code Line Counter hands you the result as a sensibly named file. Filenames are derived from your input where possible, so a quick batch of jobs leaves you with a tidy folder rather than a pile of generic "output (3)" files. Nothing is auto-saved on Favtoo's side because nothing was ever sent there.
Code Line Counter is structured around the idea that a useful tool should be its own page. Open the page, do the work, close the tab — the page is the entire product. There is no onboarding flow because there is nothing to onboard into.
Code Line Counter is built around the moment of need: a focused page you open when you have a specific task, complete the task, and close. The catalog contains many adjacent tools so the same model serves the surrounding parts of a typical developer utility workflow.
Pro tip: Code Line Counter works just as well in a private/incognito window as in a normal one, which is occasionally useful when you want zero browser-history footprint of the job. Another tip: if the tool ever feels slow, it is almost always because the browser tab is competing for CPU with another tab — pausing or closing the heavy ones gives the engine room to work.
If Code Line Counter appears to hang, the engine is almost certainly still working — large inputs simply take longer to process inside a browser than they would on a server with multi-core scheduling. For inputs near the 0 MB cap, give it up to a minute on a typical laptop before assuming something is stuck.
That is essentially everything Code Line Counter does and how it does it. Open the tool above, drop in your input, and the work happens in the page. If you find yourself reaching for it often, bookmark the page — it loads quickly on subsequent visits, and your most-recent settings are remembered for the rest of the session.
How it works
- 1Land on the Code Line Counter page. The tool is ready to use the moment the page renders.
- 2Add your developer input by dropping it onto the page or browsing for it.
- 3Adjust the options to match what you need. Sensible defaults cover the most common case, so you can usually skip this step.
- 4Click to start the job. The engine (standard browser APIs) processes the input in the page; you can watch the progress indicator until it completes.
- 5Download the result. The file is generated in your browser and saved through your normal download flow.
- 6Run additional jobs as needed. The same controls and defaults apply on every run.
Common use cases
- Compare two API responses to spot a regression using Code Line Counter.
- Inspect a regex against a test string before committing it.
- Validate a config blob before pushing to staging.
- Format a noisy log line into something a teammate can read.
- Hash a string for a quick reproducibility check.
- Generate a quick fixture without leaving the browser.
- Generate boilerplate from a single specification line.
- Convert between data formats while wiring up an integration.
- Pretty-print a minified blob during incident triage.
- Encode binary content for transport in a JSON body.
FAQ
What languages are supported?
JavaScript/TypeScript (// and /* */), Python (# and triple-quotes), Java/C/C++ (// and /* */), and Ruby (#).
What counts as a comment line?
Lines starting with comment syntax (// or #), block comment lines (/* ... */), and Python docstrings.
What counts as a blank line?
Lines containing only whitespace (spaces, tabs) or completely empty lines.
Is inline commenting counted?
Lines with both code and comments are counted as code lines. Only pure comment lines are counted as comments.
What is the code ratio?
The percentage of total lines that are actual code (excluding blanks and comments), shown as a visual bar.
Is my code private?
Yes — counting runs entirely in your browser with no uploads.
How do I know I am using the latest version of Code Line Counter?
Code Line Counter is updated whenever the underlying engine releases an improvement or a bug fix. Because the tool is delivered as a static page, every visit fetches the latest version automatically — there is no "version" to manage on your end. If a particular release ever changes default behaviour, the change is documented on Favtoo's changelog so you can confirm what shifted.
Can I use Code Line Counter offline?
Once the page is loaded, Code Line Counter can complete jobs without an active internet connection — the engine is bundled with the page, so there is no per-job network call. The initial page load does require a connection (to fetch the static assets), but after that you can disconnect entirely and the tool will still work. This is a side-effect of the local-first architecture, not a deliberate "offline mode" feature.
What does the error message in Code Line Counter mean?
Failures usually fall into one of three buckets: the input is in an unsupported format, the input is over the size cap, or the input is structurally malformed (a truncated download, a partial export, or a stream the engine does not recognise). The first two are easy to confirm — check that your file is in a supported format and that it is below 0 MB. For the third, opening the file in its native viewer first is the fastest way to confirm the source is intact.
Do I need to install anything to use Code Line Counter?
No installation is needed. Code Line Counter runs as a normal web page, with no browser extension, no native helper, and no separate desktop client to download. That is partly a privacy choice — extensions can request broad permissions, while a regular page is sandboxed by default — and partly a convenience one: you can use Code Line Counter on any computer you have temporary access to without leaving anything installed on it.
Is the source for Code Line Counter available?
Code Line Counter is a static page running an open-source engine in your browser, so a typical corporate firewall does not get in the way as long as it allows JavaScript to load from Favtoo. For teams that need to host it themselves on an internal network, the underlying engine (standard browser APIs) is open-source and can be packaged into a private build with the same behaviour. Reach out via the Contact page if that is something you are exploring.
Will I notice a difference in the output from Code Line Counter?
Code Line Counter is built to preserve quality wherever the underlying developer format allows it. Operations that are mathematically lossless (e.g. structural transformations, lossless re-encoding) round-trip with no perceptible change. Operations that involve a lossy codec inevitably introduce small artefacts at the byte level, but the defaults aim at the sweet spot where output looks or sounds the same to a normal viewer or listener while still being meaningfully smaller or faster than the input.
Why use Code Line Counter instead of a paid online tool?
Desktop apps usually have more advanced features but require installation, maintenance and (often) a licence. Paid online tools are convenient but route your file through their servers and gate downloads behind accounts. Code Line Counter sits in between: free, instant, and private, but intentionally narrow in scope. For one-off jobs and the common developer utility operations, it is usually the lowest-friction choice; for highly specialised work, a dedicated app is still the right answer.
Where does my file actually go when I use Code Line Counter?
Your file is processed inside your browser by standard browser APIs. The engine reads the file's bytes from your tab's memory, computes the result, and writes the result back into the tab. You can confirm what the page does by opening developer tools and watching the Network tab during a run — the requests you see are for the tool's static assets only.