![]() |
VOOZH | about |
dotnet add package NCalcSync.signed --version 6.2.0
NuGet\Install-Package NCalcSync.signed -Version 6.2.0
<PackageReference Include="NCalcSync.signed" Version="6.2.0" />
<PackageVersion Include="NCalcSync.signed" Version="6.2.0" />Directory.Packages.props
<PackageReference Include="NCalcSync.signed" />Project file
paket add NCalcSync.signed --version 6.2.0
#r "nuget: NCalcSync.signed, 6.2.0"
#:package NCalcSync.signed@6.2.0
#addin nuget:?package=NCalcSync.signed&version=6.2.0Install as a Cake Addin
#tool nuget:?package=NCalcSync.signed&version=6.2.0Install as a Cake Tool
👁 GitHub Actions Workflow Status
👁 Coverage
👁 NuGet
👁 NuGet Downloads
👁 Discord
NCalc is a fast, lightweight expression evaluator for .NET. It parses and evaluates mathematical and logical expressions with literals, operators, parameters, built-in functions, and custom functions.
NCalc targets modern .NET, .NET Standard 2.0, and .NET Framework 4.8.
Start with the NCalc docs for the full language reference, runtime options, plugins, and API reference.
Useful entry points:
Use NCalc.Core for the expression engine:
dotnet add package NCalc.Core
NCalcSync and NCalcAsync are obsolete redirect packages. Use NCalc.Core directly.
Add optional packages only when you need them:
dotnet add package NCalc.LambdaCompilation
dotnet add package NCalc.DependencyInjection
using NCalc;
var result = new Expression("2 + 3 * 5").Evaluate();
// 17
var expression = new Expression("Round(Pow([x], 2) + [offset], 2)");
expression.Parameters["x"] = 3.14;
expression.Parameters["offset"] = 10;
var result = expression.Evaluate();
// 19.86
var expression = new Expression("SecretOperation(3, 6)");
expression.Functions["SecretOperation"] = args =>
(int)args.Evaluate(0) + (int)args.Evaluate(1);
var result = expression.Evaluate();
// 9
Install NCalc.LambdaCompilation first.
using NCalc.LambdaCompilation;
var expression = new Expression("1 + 2");
Func<int> function = expression.ToLambda<int>();
var result = function();
// 3
For data types, operators, built-in functions, async evaluation, caching, expression serialization, and advanced configuration, check the docs.
Open an issue for bugs or usage problems. Include the expression, the expected result, the actual result, and your NCalc version.
| Project | Description |
|---|---|
| FastExpressionCompiler | Fast compiler for C# expression trees. NCalc uses it for lambda compilation. |
| Jint | JavaScript interpreter for .NET by Sebastien Ros, the original author of NCalc. |
| JJMasterData | Runtime form generator that uses NCalc for field visibility and other dynamic behavior. |
| NCalc101 | Web application for trying NCalc expressions, developed by Panoramic Data. |
| NCalcJS | TypeScript/JavaScript port of NCalc. |
| PanoramicData.NCalcExtensions | Extension functions for NCalc, including string functions, switch, if, in, typeOf, and cast. |
| Parlot | Fast and lightweight parser creation tools by Sebastien Ros. NCalc uses Parlot in its default parser. |
Using NCalc? Create a PR and add your project here!
NCalc uses Nerdbank.GitVersioning. Each library build can be traced back to the original git commit. Read more in the release documentation.
<a href="https://star-history.com/#ncalc/ncalc&Date"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=ncalc/ncalc&type=Date&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=ncalc/ncalc&type=Date" /> <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=ncalc/ncalc&type=Date" /> </picture> </a>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.2.0 | 64 | 6/17/2026 |
| 6.1.1 | 174 | 6/11/2026 |
| 6.1.0 | 187 | 6/7/2026 |
| 6.0.0 | 109 | 6/6/2026 |
| 5.13.0 | 141 | 6/4/2026 |
| 5.12.0 | 2,560 | 2/19/2026 |
| 5.11.0 | 5,262 | 12/19/2025 |
| 5.10.0 | 318 | 12/18/2025 |
| 5.9.0 | 895 | 12/2/2025 |
| 5.8.0 | 633 | 11/4/2025 |
| 5.7.0 | 1,045 | 9/22/2025 |
| 5.6.0 | 6,132 | 8/3/2025 |
| 5.5.0 | 377 | 7/9/2025 |
| 5.5.0-alpha | 265 | 2/14/2025 |
| 5.4.2 | 1,336 | 4/29/2025 |
| 5.4.1 | 1,965 | 2/14/2025 |
| 5.4.0 | 256 | 2/14/2025 |
| 5.3.1 | 1,232 | 12/18/2024 |
| 5.3.0 | 564 | 11/16/2024 |
| 5.2.11 | 4,449 | 10/25/2024 |