HTML Tidy for Windows, tidy.exe download, and batch files for the command prompt

tidy.zip — tidy.exe version 5.1.2 released 2015-08-15, win32
Tidy-HTML5 W3C HTACG (HTML Tidy advocacy community group) license

Requires Microsoft's free run-time, Visual C++ Redistributable for Visual Studio 2015.

Batch Files to run HTML Tidy from the Windows command prompt

XHTML 5 Batch Files

HTML 5 Batch Files

XHTML 1.0 Strict Batch Files

XHTML 1.0 Transitional Batch Files

HTML 4.01 Transitional Batch Files


HTML Tidy documentation explains the settings in the files below. Two settings require mention. First, the batch files assume the input files use UTF-8 character encoding. Second, the newline option is set to save files in the Unix / Linux format.

Batch files for individual files can be run on files that also contain script, PHP, ASP, etc. However, the batch files for groups of files assume an HTML file extension.

XHTML 5 Batch Files

tx.bat - When run, "tx filename," runs Tidy on the file.

@echo .
@echo .
@tidy --doctype html5 --output-xhtml yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes %1

txall.bat - When run, "txall," runs Tidy on all HTML files in the active directory and its subdirectories.

for /f "tokens=*" %%a in ('dir /b /s *.html') do tidy --doctype html5 --output-xhtml yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes "%%a" | echo file: %%a
@echo .
@echo .
@dir *.html /o:d

HTML 5 Batch Files

th.bat - When run, "th filename," runs Tidy on the file.

@echo .
@echo .
@tidy --doctype html5 --output-html yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes %1

thall.bat - When run, "thall," runs Tidy on all HTML files in the active directory and its subdirectories.

for /f "tokens=*" %%a in ('dir /b /s *.html') do tidy --doctype html5 --output-html yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes "%%a" | echo file: %%a
@echo .
@echo .
@dir *.html /o:d

XHTML 1.0 Strict Batch Files

ts.bat - When run, "ts filename," runs Tidy on the file.

@echo .
@echo .
@tidy --doctype strict --output-xhtml yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes %1

tsall.bat - When run, "tsall," runs Tidy on all HTML files in the active directory and its subdirectories.

for /f "tokens=*" %%a in ('dir /b /s *.html') do tidy --doctype strict --output-xhtml yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes "%%a" | echo file: %%a
@echo .
@echo .
@dir *.html /o:d

XHTML 1.0 Transitional Batch Files

tt.bat - When run, "tt filename," runs Tidy on the file.

@echo .
@echo .
@tidy --doctype loose --output-xhtml yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes %1

ttall.bat - When run, "ttall," runs Tidy on all HTML files in the active directory and its subdirectories.

for /f "tokens=*" %%a in ('dir /b /s *.html') do tidy --doctype loose --output-xhtml yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes "%%a" | echo file: %%a
@echo .
@echo .
@dir *.html /o:d

HTML 4.01 Transitional Batch Files

t4.bat - When run, "t4 filename," runs Tidy on the file.

@echo .
@echo .
@tidy --doctype loose --output-html yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes %1

t4all.bat - When run, "t4all," runs Tidy on all HTML files in the active directory and its subdirectories.

for /f "tokens=*" %%a in ('dir /b /s *.html') do tidy --doctype loose --output-html yes --char-encoding utf8 --newline lf --clean yes --indent auto --tidy-mark no --wrap 0 --write-back yes "%%a" | echo file: %%a
@echo .
@echo .
@dir *.html /o:d

Site sponsor

Hardcover Web Design