Scriban — Fast, powerful text templating for .NET

Scriban

A fast, powerful, safe and lightweight scripting language and text templating engine for .NET.

dotnet add package Scriban

Available on NuGet — .NET Standard 2.0+

Playground

Try Scriban live! Edit the template or data and click Run (or press Ctrl+Enter) to see the output.

Checking service availability…
Hello World!
<ul>
  <li>APPLE</li>
  <li>BANANA</li>
  <li>CHERRY</li>
</ul>
Fast & lightweight

Scriban uses a custom Lexer/Parser with a full AST for blazing-fast parsing and low-allocation rendering. CPU and GC-friendly by design.

Language reference · Built-in functions

Safe sandbox

By default, no .NET objects are exposed unless explicitly allowed. You control exactly what is available to templates — perfect for user-facing scenarios.

Runtime & security · Safe runtime

Liquid compatible

Parse and render Liquid templates with Template.ParseLiquid. Migrate from Liquid to Scriban incrementally, or use both side by side.

Liquid support

Extensible runtime

Import .NET classes, delegates, or custom IScriptCustomFunction implementations. Use member renamers, filters, and template loaders to tailor the engine.

.NET runtime API · Custom functions

Async support

Full async/await support with Template.RenderAsync. Evaluate templates without blocking — ideal for web servers and cloud functions.

Getting started · Runtime API

Rich language

Variables, expressions, conditionals, loops, functions, pipes, objects, arrays — all the constructs you need for powerful templating and scripting scenarios.

Language reference · Examples

Quick example
using Scriban;

// Parse a template
var template = Template.Parse("Hello {{ name }}! You have {{ count }} messages.");

// Render with a model
var result = template.Render(new { Name = "Alice", Count = 5 });
// => "Hello Alice! You have 5 messages."

For more examples, see the Getting started guide.