I this tutorial i'll show you how to minify HTML in ASP.NET MVC or ASP.NET Web Forms. To make your site load faster, you should minimize downloads of resources.

You can use https://developers.google.com/speed/pagespeed/insights/?hl=en to  check the performance of your websites

First you need to download Minifier Html tool from https://github.com/deanhume/html-minifier

This is a simple command line tool to minify your HTML, Razor views & Web Forms views. By minifying your HTML on bigger web pages, you'll save on bytes that your clients need to download.

Open Properties->PublishProfiles->Open your pubxml extension file

Minifying HTML for ASP.NET MVC

Add HtmlMinifier.exe to your publishing profile

<?xml version="1.0" encoding="utf-8"?>
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
  <Target Name="CustomAction" AfterTargets="CopyAllFilesToSingleFolderForPackage">
    <Message Text="Minifying files....." />
    <Exec Command="D:\Publish\HtmlMinifier.exe $(_PackageTempDir)" IgnoreExitCode="true" />

Note: Copy HtmlMinifier.exe to your publishing project directory, then publish your project

For example: Original html

    <li>@Html.ActionLink("Home", "Index", "Home")</li>

After Minifying HTML

<h2>c-sharpcode.com</h2><ul><li>@Html.ActionLink("Home", "Index", "Home")</li></ul>

I hope you can optimize your site's performance by using the HtmlMinifier tool