formerly .NET Interactive

Work across languages in one notebook.

Microsoft's Polyglot Notebooks bring C#, F#, PowerShell, JavaScript/TypeScript, SQL and more together inside VS Code. Mix languages, share variables, visualize data, create diagrams, and ship repeatable, runnable docs — all in a familiar, Jupyter-like notebook experience.

No affiliation with Microsoft. Community resource created by Microsoft MVP Lee Englestone.
What it looks like
Polyglot Notebook in VS Code with mixed C#, F#, and Mermaid cells
Real screenshot from the VS Code docs. Click to view full size.
C# JavaScript SQL PowerShell
Open-source friendly. Bookmark for later.

In-app experience (VS Code)

Below are real screenshots from the official VS Code docs showing the Jupyter‑like notebook UI for Polyglot Notebooks.

Example of a Polyglot Notebook in VS Code with C#, F#, and Mermaid cells
Example notebook with mixed languages (C#, F#, Mermaid) and outputs.
Kernel picker for Polyglot Notebooks in VS Code
Kernel picker (choose .NET Interactive for .ipynb).
Cell language picker showing C#, F#, HTML, JavaScript, Mermaid, PowerShell, SQL
Per‑cell language picker (C#, F#, JS, HTML, Mermaid, PowerShell, SQL, KQL).
Connecting to SQL from a Polyglot Notebook and running a query
Connecting to SQL and running a query directly from a notebook.
Polyglot Notebooks extension in the VS Code Marketplace
Polyglot Notebooks extension listing in the Marketplace.
Screenshots from the VS Code Polyglot Notebooks documentation. © Microsoft.

How to use Polyglot Notebooks

Everything you need to get up and running in minutes inside VS Code.

  1. Install prerequisites
    VS Code and the Polyglot Notebooks extension. Install the .NET 7/8 SDK for C#/F# support.
  2. Create a notebook
    Use .dib in VS Code (or .ipynb). Add a cell and choose a language via #!csharp, #!fsharp, #!pwsh, #!javascript, #!sql, etc.
  3. Bring in packages
    In C# or F#: #r "nuget:Package, Version". Then using Namespace;.
  4. Share variables across languages
    Define data in one cell/language and reuse it in another. Great for mixing data prep (C#) with viz (JS).
  5. Render rich outputs
    Display tables, HTML, and charts directly in the notebook. Use JS libs (Observable Plot, D3) or .NET plotting.
Keyboard shortcuts (VS Code notebooks)
Action Windows / Linux macOS
Open Command Palette Ctrl+Shift+P ⌘⇧P
Run cell Shift+Enter ⇧Enter
Run cell (stay on cell) Ctrl+Enter ⌘Enter
Insert code cell below Alt+Enter ⌥Enter
Change cell language Ctrl+K, M ⌘K, M
Move cell up / down Alt+↑ / Alt+↓ ⌥↑ / ⌥↓
Format cell Shift+Alt+F ⇧⌥F
Find within notebook Ctrl+F ⌘F

Shortcuts are VS Code defaults and may vary if you customized keybindings. See Keyboard Shortcuts and Notebook shortcuts for the latest.

Quickstart snippets (.dib)

1) NuGet + Math (C#)
#!csharp
#r "nuget:MathNet.Numerics, 5.0.0"
using MathNet.Numerics.Statistics;

var data = new double[] { 1.2, 2.5, 2.9, 3.1, 4.0, 5.6 };
new {
  Count = data.Length,
  Mean = data.Mean(),
  StdDev = data.StandardDeviation(),
  Min = data.Minimum(),
  Max = data.Maximum()
}
2) Simple DataFrame (C#)
#!csharp
#r "nuget:Microsoft.Data.Analysis"
using Microsoft.Data.Analysis;

var names = new StringDataFrameColumn("Name", new[] { "Alice", "Bob", "Cara" });
var scores = new Int32DataFrameColumn("Score", new[] { 85, 92, 78 });
var df = new DataFrame(names, scores);
df
3) Plotly.NET chart (F#)
#!fsharp
#r "nuget:Plotly.NET.Interactive"
open Plotly.NET

let x = [1;2;3;4]
let y = [10;20;30;40]
Chart.Line(x, y)
4) Mermaid diagram (JS)
#!javascript
import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs";
const el = document.createElement('div');
el.className = 'mermaid';
el.textContent = 'graph TD; A[User]-->B[Notebook]; B-->C[C#]; B-->D[JavaScript]; C-->E[Output]; D-->E;';
display(el);
await mermaid.run();

Resources & Links

Official docs, repos, and community learning.


LinkedIn Learning: Exploring Data Science with .NET using Polyglot Notebooks

Course by Matt Eland covering ML.NET, data exploration, and Polyglot Notebook workflows.

LinkedIn Learning

View the course
Book: Data Science with .NET and Polyglot Notebooks

By Matt Eland. Practical data science with .NET, notebooks, and ML.NET.

Matt Eland book

View on Amazon

Examples of great usage

Inspiration for mixing languages and audiences.

Product Tutorials & SDK Guides

Ship runnable docs: explain concepts with markdown, call your SDK via C#, then visualize responses in JS.

  • Markdown + C# + JS (charts)
  • Copy-paste friendly snippets
Data Science Prototypes

Use C# for data wrangling and models, JS for visualizations, and SQL cells to query local/remote data.

  • NuGet ML packages
  • Observable Plot / D3 viz
DevRel Demos & Conference Labs

Create guided labs where attendees run code per step and keep the notebook as reference.

  • Self-contained exercises
  • Richer than gists/slides
Ops Runbooks & Automation

PowerShell cells for scripts, C# for helpers, and markdown checklists for safe, repeatable ops.

  • pwsh + C# utilities
  • Inline logs & tables
Teaching CS & Algorithms

Alternate between explanation and code. Compare C# and F# versions side-by-side.

  • Markdown pedagogy
  • Multiple-language views
API Exploration & Testing

Call REST APIs from C#, parse JSON, then render HTML tables or charts for quick exploration.

  • HttpClient + LINQ
  • display(HTML) outputs

FAQ

Use .dib for Polyglot Notebooks in VS Code, or .ipynb if you prefer the Jupyter format. Both work with the extension.

Commonly: C#, F#, PowerShell, JavaScript/TypeScript, and SQL. Support can evolve—check the extension page for the latest.

Yes. In C#/F# cells use #r "nuget:Package, Version" then import with using or open.

Commit .dib files to Git, or export to .ipynb. Include a README and Requirements (SDK versions, extension link).