Use the command line (console) tool htmlval
for Mac/macOS to check HTML, CSS, and JSON documents on macOS, and try using it with your favorite Mac editor (see integration with Mac editors).
htmlval
is based on the core validation engine in CSS HTML Validator for Windows, which has been ported to macOS.
Note that some features like link checking, spell checking, PHP syntax checking, JavaScript checking, and some other features are currently not available in the macOS port. This is a command line (console) tool for macOS; there is no GUI like in the Windows version.
Current trial version (arm64/M1/M2/Mx): htmlval
for Mac (ARM) Trial 2023 (v23.0030)
Download htmlval for Mac (ARM) FREE Trial • How to Install
Current trial version (Intel/x86_64): htmlval
for Mac (Intel) Trial 2023 (v23.0022)
Download htmlval for Mac (Intel) FREE Trial • How to Install
The free trial of htmlval
is fully functional (with no time limit) except for the maximum number of errors and warnings being locked to 10 each.
To install, download htmlval for Mac (Intel) trial or download htmlval for Mac (Intel) (Paid Version) and then extract the files. The 'xxxxxx
' represents "trial" (for the trial version) or the actual version number (for the paid version). After extraction you'll see a new htmlval directory with the needed files inside.
$ tar -xvf htmlval-mac-intel-xxxxxx.tgz
Next, run the install script as root to copy the files into the proper location. htmlval
is copied to /usr/local/bin and htmlvalV230.cfg
is copied to /etc/htmlval. See the README
file if you want to do a manual install.
# cd htmlval # ./install-htmlval
or (when not root)
$ cd htmlval $ sudo ./install-htmlval
[ To the top ]
The main documentation for htmlval
for Linux and htmlval
for Mac has been combined into a single htmlval Documentation page.
To uninstall, you can run the uninstall script as root to remove htmlval
and htmlvalV230.cfg
. Then you can manually delete any remaining htmlval
folder and htmlval*.tgz
file.
# ./htmlval/uninstall-htmlval
or (when not root)
$ sudo ./htmlval/uninstall-htmlval
[ To the top ]
If you like what you see and would like to buy a license and support continued development of htmlval
, then you can buy a license for CSS HTML Validator Pro for Windows or CSS HTML Validator Enterprise for Windows. These editions include htmlval
. Note that htmlval
is not included with the Home edition.
You can also buy an htmlval-only license for $69 $49 (INTRO OFFER) which includes only the command line (console) tool for both Linux and Mac. IMPORTANT: This htmlval-only license does not include the Windows GUI app.
[ To the top ]
Below you will find helpful information on using htmlval
with various Mac editors. This is a new list and we are adding editors as needed and requested. Is your favorite Mac HTML editor missing or do you have a suggestion for an improvement? If so then please contact us or post in our forum and request that it be added.
Sublime Text: Go to Tools > Build System > New Build System. A default build document should open. Replace it with the following:
{ "shell_cmd": "htmlval -lhs --format \"%file%(%linenum%:%charnum%): %Type% - %msgtext%\" \"${file}\"", "file_regex": "^\\s*(\\S[^:]*)\\((\\d+):(\\d+)\\):\\s+([^\\n]+)" }
Go to File > Save (or press Cmd+S) and save it as htmlval.sublime-build
in Sublime Text's User
folder (something like /Users/(username)/Library/Application Support/Sublime Text/Packages/User/htmlval.sublime-build
).
With the "htmlval" build system selected in Tools > Build System > htmlval, you can use Tools > Build (or Cmd+B) to perform a build, which will save the current document (which must have a filename) and then validate it with htmlval
. The validation messages should appear in Sublime Text's window. You can use F4 to scroll through the validator messages (Shift+F4 goes backwards).
Visual Studio Code: Close all projects and file. Go to Terminal > Configure Tasks. Choose Create tasks.json file from template then (if needed) choose Others. Copy and paste this htmlval task into the tasks.json
file and save it. When editing an HTML or CSS files, you can run this task by choosing Terminal > Run Task and the "htmlval" task. Use F8 when the editor has focus to go to the next problem (i.e. validator message).
OPTIONAL: To more easily run the "htmlval" task, go to Code > Preferences > Keyboard Shortcuts and assign F6 as a keyboard shortcut to Tasks: Run Task (optionally setting 'When' to editorFocus by right-clicking and choosing Change When Expression). You can then press F6 and then ENTER to select the top task (assuming the top task is "htmlval").
[ To the top ]