How to Make a Sankey Diagram

Cody Schneider8 min read

Sankey diagrams are one of the best ways to visualize how something flows through a process. Whether you're tracking website visitors, marketing budgets, or inventory, a good Sankey chart tells a compelling story at a glance. This article will walk you through what Sankey diagrams are, why they’re so useful, and how to create them yourself using a few popular tools.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

What Exactly is a Sankey Diagram?

A Sankey diagram is a type of flow diagram where the width of the arrows or bands is proportional to the quantity of the flow. In simple terms, bigger streams represent bigger numbers. Instead of just seeing percentages in a table, you instantly see the major paths and the slight trickles within a system.

Each diagram is made of two basic components:

  • Nodes: These are the stages or categories in your process. For a website, nodes might be "Paid Traffic," "Homepage," "Pricing Page," and "Converted."
  • Links: These are the flowing bands that connect the nodes, showing the movement from one stage to another. The width of a link shows its value or volume.

Imagine tracking visitors to your e-commerce site. A Sankey diagram could show you a thick band flowing from "Facebook Ads" to your "Product Page," with a slightly smaller band moving to "Add to Cart," and an even thinner band actually reaching "Purchase." At the same time, you would see large drop-off flows branching off at each stage, giving you a clear picture of user navigation and abandonment.

Why Use a Sankey Diagram?

Sankey diagrams are powerful because they distill complex data into a simple, visual story. They excel at showing many-to-many relationships and highlighting the most significant contributions in a process.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

1. Highlight Dominant Paths and Drop-Offs

The most obvious benefit is immediately seeing the "main rivers" and largest exits in your system. Trying to spot this in a spreadsheet can be tedious, but a Sankey diagram makes it glaringly obvious. For marketers, this is perfect for identifying which channels contribute the most conversions or where the biggest leaks in your funnel are.

2. Visualize Complex Systems Clearly

When you have multiple sources flowing to multiple destinations, simple bar or pie charts can't capture the interconnectivity. A Sankey shows the entire system in one view, whether you're mapping a customer journey across multiple touchpoints or tracing how a budget is allocated across different marketing activities that ultimately lead to sales.

3. Tell a Compelling Data Story

Presenting data is often about storytelling. A Sankey diagram is naturally narrative, guiding the viewer's eye from a starting point to an endpoint and illustrating the journey in between. This makes it far more engaging and easier to digest for stakeholders who aren’t comfortable with raw data tables.

Before You Build: Understand Your Data Structure

To create a Sankey diagram, your data needs to be structured in a specific way. You can't just throw any dataset at it. You need a list of flows tracking a quantity from one place to another. At a minimum, your dataset should have three columns:

  • Source: The starting node for a flow. (e.g., 'Facebook Ads')
  • Target: The destination node for the flow. (e.g., 'Landing Page')
  • Value: The numerical quantity of that flow. (e.g., '5000' representing visitors)

Here’s what a simple dataset for analyzing marketing campaign traffic might look like:

When you map this data, you’ll see the flows from your acquisition channels to your website pages, and then from those pages to a final action or a drop-off. For multi-step journeys, a Target category (like 'Homepage') can become a 'Source' in the next part of the flow.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

How to Create a Sankey Diagram: Step-by-Step

You don’t need to be a data scientist to create a Sankey diagram. Here are a few accessible ways to build one, ranging from quick online tools to more robust business intelligence platforms.

Method 1: Using Online Generators (SankeyMATIC)

For quick, one-off visualizations without any software, web-based generators are perfect. SankeyMATIC is a popular and straightforward option.

Perfect for: Anyone who needs a simple, static chart fast without any setup.

  1. Format Your Data: On each line, type your flow in this simple format: Source [Value] Target. For our example dataset above, the first line would be Google Ads [10000] Homepage.
  2. Input Your Data: Copy and paste your formatted data directly into the input box on the SankeyMATIC website. The tool will generate a preview automatically.
  3. Customize: Use the settings to adjust node color, link color, chart background, width, and spacing. You can fine-tune the aesthetics to match your presentation.
  4. Export: Once you’re happy with the result, you can export your diagram as a static PNG or a scalable SVG image.

Method 2: Using Looker Studio (formerly Google Data Studio)

If you need interactive dashboards that pull data directly from sources like Google Sheets or Google Analytics, Looker Studio is an excellent free choice.

Perfect for: Marketers and business users who want live, filterable dashboards.

  1. Organize your data: Set up your data in a Google Sheet with three clear columns: ‘Source’, ‘Target’, and ‘Value’ (or a similar name for your metric, like ‘Sessions’ or ‘Users’).
  2. Connect Your Data Source: In Looker Studio, create a new report and choose "Google Sheets" as your data connector. Select your spreadsheet and worksheet.
  3. Add the Sankey Visualization: Looker Studio doesn’t have a native Sankey chart, but you can add one from the community visualizations. Go to the toolbar and click Add a chart, then click the "Community Visualizations and Components" icon at the bottom. Search and select the "Sankey Diagram" created by Dataviz.
  4. Configure the Chart: With your Sankey chart on the canvas, head to the "Setup" panel on the right.
  5. Style as Needed: Switch to the "Style" panel to adjust colors, labels, link styles, and get everything looking professional.
GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Method 3: Using Tableau

For advanced BI users comfortable with a more powerful tool, Tableau offers the most customization and analytical depth, though the setup is more involved.

Perfect for: Data analysts and BI specialists who need highly customized and detailed Sankey visualizations integrated into larger dashboards.

Creating a Sankey in Tableau from scratch is an advanced technique that requires some specific data structuring (often called "data densification") and a series of calculated fields to draw the curved paths. While it's too much to detail every formula here, here's the general concept:

  1. The Data Model: Unlike simple tools, Tableau often requires joining your flow data to a separate model or template that provides the scaffolding needed to draw smooth curves.
  2. Calculated Fields: You'll create several calculated fields to handle things like positioning the nodes, determining the size of the bands, and plotting the points along the curves (usually using a Sigmoid function).
  3. Use a Template: The easier path is to search for a "Tableau Sankey Template" online. Many expert users have shared workbooks that you can download and adapt with your own data, saving you from writing dozens of calculations.
  4. Build the Sheet: In a worksheet, you’ll typically place your path calculations on the Rows shelf, your positioning calculations on the Columns shelf, and then add your source, target, and value fields to the Marks card to color and correctly size your bands.

While Tableau has the steepest learning curve, the results are highly polished, fully interactive visualizations that integrate seamlessly with other elements in your dashboards.

Best Practices for Effective Sankey Diagrams

No matter the tool you use, a few design principles will make your diagrams clearer and more impactful.

  • Keep It Simple: Avoid visualizing too many flows or nodes at the same time. Too many crossing lines can create a "spaghetti diagram" that is hard to read. Consolidate smaller, insignificant categories into an "Other" category if needed.
  • Organize Your Nodes Logically: Arrange your nodes to tell a story from left to right. This left-to-right reading order makes the flow intuitive and easy to follow.
  • Use Color Thoughtfully: Color can be a powerful tool to group related data. Use one color for all drop-offs to make them stand out. You can also color nodes by category or assign a brand color to an important path.
  • Label Clearly, But Not Excessively: Make sure your nodes are clearly labeled. If adding values to every link makes the diagram cluttered, consider using an interactive version where values appear on hover or in a tooltip.

Final Thoughts

Sankey diagrams take a complex system and turn it into an intuitive, visual narrative, making them an incredible asset for anyone involved in analytics and reporting. With user-friendly online tools and increasingly powerful BI platforms, you no longer need a data science background to map out your business's most important flows.

We believe the hardest part of data analysis isn't making the chart - it's getting clean, reliable data from all your different platforms in one place. Instead of spending hours exporting CSVs just to see how your campaigns in Google Ads lead to purchases in Shopify, we designed Graphed to do the hard work for you. Simply ask for the insight you want, like "show me the customer journey from Facebook ads to purchase," and get connected, live visualizations in real-time, letting you jump straight to making decisions.

Related Articles