KHTML is the HTML layout engine developed by the KDE project.

It was created for and is used in KDE's Konqueror file and web browser. The engine was later adopted by Apple for its Safari browser, and the company promised to return all improvements to the main code branch. Another company using KHTML for their product is YellowTAB - the company that bought the rights of BeOS.

It is written in C++ and licensed under the LGPL. It supports HTML 4, CSS 1 and 2, DOM and JavaScript. Some extra abilities and quirks from Internet Explorer are supported, even though they are not part of the HTML standard definition.

KHTML is fast, but less error tolerant than the Gecko layout engine, its main open source rival and core of the Mozilla browser.