ClickHouse Online Compiler

About the ClickHouse compiler

Column-oriented analytics SQL, translated to DuckDB and run in your browser. The WASM build has no timezone database, so now() is evaluated as a local timestamp. Run ClickHouse code in your browser with no install and no signup — the editor, the input and the output share one screen. ClickHouse compiles and runs on your own device through WebAssembly, so once the page has loaded it keeps working without a network connection.

Press Run to execute the program, edit it and press Run again, or paste your own code over it. Everything you type stays in the page; the editor caches your work locally so a reload does not lose it.

A ClickHouse example

This is the program the ClickHouse editor opens with — run it as it is, then change it.

-- ClickHouse SQL — translated to DuckDB and run in your browser.
-- toStartOfHour() and now() - INTERVAL are translated for the WASM build;
-- now() is a plain timestamp there because the build has no timezone data.
CREATE TABLE analytics (
    timestamp DateTime,
    user_id UInt32,
    event String,
    properties String
) ENGINE = MergeTree()
ORDER BY (timestamp, user_id);
INSERT INTO analytics VALUES
    ('2024-01-01 09:15:00', 1, 'page_view', '{"page": "/home"}'),
    ('2024-01-01 09:30:00', 2, 'click', '{"button": "signup"}'),
    ('2024-01-01 10:05:00', 1, 'page_view', '{"page": "/pricing"}');
-- Aggregation query
SELECT
    toStartOfHour(timestamp) as hour,
    event,
    count() as events,
    uniq(user_id) as unique_users
FROM analytics
GROUP BY hour, event
ORDER BY hour;
-- Window functions

The editor opens with the full program.

More Databases compilers

Browse all 109 languages — the same editor runs each of them, in the browser or on a shared runner.