---
title: "Hex"
description: "Hex is a cloud-based notebook platform that combines SQL, Python, R, and no-code cells for data analysis, and for publishing the results as interactive apps and dashboards."
canonical: "https://motherduck.com/glossary/hex/"
related:
  - title: "Hex | MotherDuck Docs"
    url: "https://motherduck.com/docs/integrations/bi-tools/hex/"
  - title: "DuckLake Architecture Deep Dive"
    url: "https://motherduck.com/blog/ducklake-architecture-deep-dive/"
  - title: "Hex + MotherDuck Integration | DuckDB Analytics"
    url: "https://motherduck.com/ecosystem/hex/"
gated_asset:
  title: "DuckLake on MotherDuck"
  url: "https://motherduck.com/product/ducklake/"
---

# Hex

> Hex is a cloud-based notebook platform that combines SQL, Python, R, and no-code cells for data analysis, and for publishing the results as interactive apps and dashboards.

## Overview

Hex is a collaborative notebook environment aimed at data teams who want to move between exploratory analysis and polished, shareable output without switching tools. A Hex "project" is a notebook that mixes SQL cells, Python or R cells, and no-code input cells (dropdowns, date pickers, text inputs), which can then be published as an interactive data app for non-technical stakeholders, alongside more traditional scheduled reports and dashboards.

<glossary-callout video="smarter-ai-workflows-with-hex-motherduck" />

## How SQL cells work

Every SQL cell in Hex has a built-in DuckDB-powered SQL IDE. A SQL cell can query two kinds of sources: a connected data warehouse (Snowflake, BigQuery, Postgres, and others), where the query is pushed down and executed remotely, or an in-memory dataframe already loaded into the notebook's Python kernel, in which case Hex uses DuckDB to run the SQL directly against that dataframe. That second mode lets an analyst write plain DuckDB-dialect SQL against a pandas or Polars dataframe mid-notebook, without exporting it to a table first.

```sql
-- SQL cell querying a dataframe already in the notebook
select
  category,
  avg(order_total) as avg_order_value
from orders_df
group by category
order by avg_order_value desc
```

Results can be returned either as a new dataframe stored in the notebook (useful for chaining further transformations without re-hitting the source) or left as a live query against the warehouse for very large results.

## Hex and MotherDuck

Hex also integrates directly with MotherDuck as a data source, so a notebook can combine cloud-hosted DuckDB tables with local dataframe analysis and Python-based modeling in the same project, then publish the result as a shareable app.