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.
What it looks like
#!csharp
var x = new[]{1,2,3};

#!javascript
// uses C# variable
x.map(n => n*10);
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.
Clipboard-ready quickstart
#!csharp
Console.WriteLine("Hello from C#");

#!javascript
console.log('And hello from JS');
  • Tip: use Add Cell to switch languages.
  • Use Shift+Enter to run the current cell.
  • Use markdown cells for narrative and documentation.

Quickstart snippets (.dib)

1) NuGet + Math (C#)
#!csharp
#r "nuget:MathNet.Numerics, 5.0.0"
using MathNet.Numerics.Statistics;
var data = new double[]{ 2.0, 3.5, 7.1, 4.2, 6.0 };
data.Mean();
2) Share data (C# → JS)
#!csharp
var values = new[]{1,2,3,4,5};

#!javascript
values.map(x => x * 10);
3) Inline SQL
#!sql
CREATE TABLE People(Id INT, Name NVARCHAR(50));
INSERT INTO People VALUES (1, 'Alice'), (2, 'Bob');
SELECT * FROM People;
4) Viz with Observable Plot (JS)
#!csharp
var chartData = new [] {10, 20, 30, 40};

#!javascript
import * as Plot from "https://cdn.jsdelivr.net/npm/@observablehq/plot@0.6/+esm";
display(Plot.plot({
  y: { label: 'Value' },
  marks: [ Plot.barY(chartData) ]
}));

Resources & Links

Official docs, repos, and community learning.

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).