Example HTML: <html><body> a & b </body></html> Command line: tidy5 --quote-ampersand yes --preserve-entities yes foo.html > tidied.html I would expect that it convert the unescaped & to & but it does not if --preserve-entities is set.