# HTML Reports

- Section: Documentation > Guides > HTML Reports
- Canonical: https://covdbg.com/docs/guides/html-reports/

---

Turn a coverage database into a static report for reviewing files, functions, and uncovered lines in a browser.

## Export a Report

After collecting coverage, convert the database into a report directory:

```powershell
covdbg convert --input coverage.covdb --format HTML --output coverage-html
Start-Process ./coverage-html/index.html
```

The exporter creates the output directory automatically. Open `index.html` directly in a browser. The report includes its styles and scripts locally, with no web server, internet connection, CDN, or fetch requests required.

To give the report a project-specific title:

```powershell
covdbg convert --input coverage.covdb --format HTML --output coverage-html --html-title "My project coverage"
```

## Find the Untested Code

The overview shows line and function coverage totals, directory summaries, and links to individual source files. Filter files by path, show only files with uncovered lines, or sort by the number of uncovered lines.

The report opens as a single page. Choosing a file in the tree loads its source from the `data` directory without reloading, and the address bar keeps a link to the selected file and line. Each file also exists as a plain page under `files`, which is what a browser without JavaScript shows.

Each file page includes:

- Source lines with execution counts and covered or uncovered marks.
- Line anchors for linking to a specific location.
- Function coverage and links to function locations.
- Previous and next uncovered-line controls.

Light and dark colors follow the browser's system preference and can be switched in the report when browser storage is available. Source and coverage remain readable with JavaScript disabled; filtering, sorting, and uncovered-line navigation use the bundled script.

## Resolve a Different Checkout

Source text is read at export time. Use the same source revision that produced the coverage database so the displayed lines match the recorded run.

If the checkout has moved, provide its root:

```powershell
covdbg convert --input coverage.covdb --format HTML --output coverage-html --html-source-root C:/checkout
```

This resolves recorded relative file paths beneath the selected directory. Files without usable relative paths are shown as unavailable. Without this option, the exporter reads recorded source paths; relative paths resolve from the current working directory.

Missing source does not hide recorded coverage. The report identifies unavailable source and coverage records beyond the current source length.

## Share or Publish

Keep the **entire output directory**. All links and assets use relative paths, so the report can also be hosted beneath a project subdirectory on a static host. The exporter writes:

| Path | Contents |
|------|----------|
| `index.html` | The overview and the entry point of the report |
| `files/file-N.html` | One plain page per source file |
| `data/file-N.js` | The source and coverage of that file, loaded on demand by the overview |
| `navigation.js` | The file tree without source text |
| `coverage.css`, `coverage.js` | The report's styles and script, with fonts included |
| `licenses.txt` | Redistribution notices for the bundled script and fonts |

Reports include source text and recorded file and function names. Share them with the same access controls you use for the source code. Exporting into the same directory again replaces the assets and removes the file pages and data payloads of an earlier export; anything else you placed there stays.

## What the Numbers Represent

Line percentages count executable coverage records only. Files without executable lines show N/A. Function coverage uses the database's precomputed function records. Gated databases are labeled in the report.

HTML export reflects the recorded run. It does not reconstruct branch coverage or compare two revisions.

## See Also

- [Report Formats](/docs/guides/report-formats/) for LCOV and GCOV export.
- [GitHub Actions](/docs/integrations/github-actions/) for collecting coverage in CI.
- [Coverage reports](/coverage-reports/) for choosing how to review and share results.
