# Parse and format HTML

Parse and format HTML on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

HtmlTinkerX

HtmlTinkerX is a powerful async C# library for HTML, CSS, and JS processing, parsing, formatting, and optimization. It provides web content processing capabilities including browser automation, document parsing with multiple engines, resource optimization, and more. PSParseHTML is the PowerShell module exposing HtmlTinkerX to PowerShell.

[View on GitHub](https://github.com/EvotecIT/HtmlTinkerX) [Visit Website](#) [Releases](https://github.com/EvotecIT/HtmlTinkerX/releases/tag/PSParseHTML-PowerShellModule.v3.0.0) [Changelog](#) [Get package](https://www.nuget.org/packages/HtmlTinkerX)

Stars**141**

Forks**17**

Open issues**0**

PowerShell Gallery downloads**94152**

Release**v3.0.10**

Language: HTML Updated: 2026-11-23

Curated Examples

Use HtmlTinkerX from C# to parse HTML and format markup.

This pattern is useful when a .NET application needs to turn HTML into structured data before saving, comparing, or reporting on it.

It is adapted from the quick-start patterns in the HtmlTinkerX README.

## When to use this pattern

- You need HTML table data in a .NET workflow.
- You want consistent formatting before storing or comparing markup.
- You prefer the C# API instead of shelling out to PowerShell.

## Example

```csharp
using HtmlTinkerX;

string html = await File.ReadAllTextAsync("page.html");

var tables = HtmlParser.ParseTablesWithAngleSharp(html);
string formatted = HtmlFormatter.FormatHtml(html);
string minified = HtmlOptimizer.OptimizeHtml(html);

Console.WriteLine($"Tables found: {tables.Count}");
await File.WriteAllTextAsync("page.formatted.html", formatted);
await File.WriteAllTextAsync("page.min.html", minified);
```

## What this demonstrates

- parsing HTML into structured table data
- formatting markup for readable output
- minifying the same document for compact output

## Source

- [HtmlTinkerX README](https://github.com/EvotecIT/HtmlTinkerX/blob/v2-speedygonzales/README.md)

<!-- PowerForge markdown artifact sha256:EE0B8636D0489ED0E86576004784ED1DC8AA5020A5AEB35CAFB0698E3ABED9C8 -->
