Convert plain text diagrams to images !

Kroki provides a unified API with support for BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), C4 (with PlantUML), Ditaa, Erd, GraphViz, Mermaid, Nomnoml, PlantUML, SvgBob and UMLet... and more to come!

Features

Ready to use
Diagrams libraries are written in a variety of languages: Haskell, Python, JavaScript, Go, PHP, Java... some also have C bindings. Trust us, you have better things to do than install all the requirements to use them. Get started in no time!
Simple
Kroki provides a unified API for all the diagram libraries. Learn once convert anywhere!
Free & Open source
All the code is available on GitHub and our goal is to provide Kroki as a free service.
Fast
Built using a modern architecture, Kroki offers great performance.
Cache with CDN coming soon
Near-instant response time if your diagram has already been generated.

Usage

Kroki provides an HTTP API to convert plain text diagrams to images. Kroki handles both GET and POST requests. When using GET requests, your diagram must be encoded in the URL using a deflate + base64 algorithm. But don't worry, if you're not familiar with deflate or base64 (or if you don't want to use them), you can also send your diagram as plain text using POST requests (see below).

Let's take an example with a GraphViz "Hello World":

hello.dot
digraph G {
  Hello->World
}

Here, we are using a Python one-liner to encode our diagram using deflate + base64:

cat hello.dot | python -c "import sys; import base64; import zlib; print(base64.urlsafe_b64encode(zlib.compress(sys.stdin.read(), 9)))"
In the documentation, we provide code examples that demonstrate how to encode a diagram in Node.js, JavaScript, Java, Python and Go.

The above command will return a value that you can copy in the URL:

GET /graphviz/svg/eNpLyUwvSizIUHBXqPZIzcnJ17ULzy_KSanlAgB1EAjQ

And here's the result:

G Hello Hello World World Hello->World

You can also call Kroki with POST:

POST /
{
  "diagram_source": "digraph G {Hello->World}",
  "diagram_type": "graphviz",
  "output_format": "svg"
}

In this case, you don't need to encode your diagram.

It's also possible to send your diagram as plain text using the Content-Type header. The output format will be specified using the Accept header and the diagram source will be sent as the request body:

POST /graphviz
Accept: image/svg+xml
Content-Type: text/plain

digraph G {
  Hello->World
}

You can also define the output format in the URL if you don't want to add an Accept header:

POST /graphviz/svg
Content-Type: text/plain

digraph G {
  Hello->World
}

The same concept applies when sending the diagram as JSON:

POST /graphviz/svg
{
  "diagram_source": "digraph G {Hello->World}"
}

Please note that you can interact with the API using any HTTP client.
If you want to learn more, head to our documentation. In particular, check out the "Usage" section to find out how to send requests to the Kroki API using:

Try

Main Base main.view singleton base.component component model main.ts
GET https://kroki.io/plantuml/svg/eNplj0FvwjAMhe_5FVZP40CgaNMuUGkcdttp3Kc0NSVq4lRxGNKm_fe1HULuuD37-bOfuXPUm2QChEjRnlIMCDmdUfHNSYY6xh42a9Fsegflk-yYlOLlcHK2I2SGtX4WZm9sZ1o8uOzxxbuWAlIGj8cshs6M1jDuY2owyU2P8jAezdnn10j53X0hlBsZFW021Pq7HaVSNw-KN-OogG8F8BAGqT8dXhZjxW4cyJEW6kcC-yHWFagHqW0MfaThhYmaVyE26P_x27qaDmXeruqqAMMw1h-ZlRI4aF3dX7hOwm5XzfIKDctlNcshPT1tFa8JPYAj-Zf5F065sqM=

Examples

Looking for inspiration? Visit the examples page.

Diagram types

The following diagram types and output formats are available:

Diagram Type png svg jpeg pdf base64
BlockDiag ✔️ ✔️ ✔️
SeqDiag ✔️ ✔️ ✔️
ActDiag ✔️ ✔️ ✔️
NwDiag ✔️ ✔️ ✔️
C4 with PlantUML ✔️ ✔️ ✔️ ✔️
Ditaa ✔️ ✔️
Erd ✔️ ✔️ ✔️ ✔️
GraphViz ✔️ ✔️ ✔️ ✔️
Mermaid ✔️
Nomnoml ✔️
PlantUML ✔️ ✔️ ✔️ ✔️
Svgbob ✔️
UMlet ✔️ ✔️ ✔️

The following diagram types will soon be available:

Diagram Type png svg jpeg pdf base64
Syntrax
Vega
Vega-Lite
WaveDrom

You don't see your favorite diagram tool in this list, please let us know 👋 [email protected].

Install

Kroki is available as a Free Service and as a Self-Managed instance.

Self-Managed

Select this option if you want to download and install Kroki on your own infrastructure or in a cloud environment.

Please note that Kroki Self-Managed requires Linux experience to install.

Please refer to the documentation to install Kroki.

Free service

Thanks to Exoscale, which has kindly offered two servers, we can provide Kroki as a free service!
However, some parts of the infrastructure are still host on other providers, so we are still looking for sponsors to cover all the expenses.

If you are interested, please 👋 contact us.

Sponsors

Thanks to our sponsors listed below, we are able to provide Kroki as a free service available to everyone.

Sponsors play a critical role, without them, we won't be able to provide Kroki as a free service.
To make Kroki sustainable, we need your support. If you want to become a sponsor, please 👋 contact us.

About

Kroki is a free service built and maintained by Yuzu tech and supported by Exoscale.

Kroki is an open source project licensed under the MIT license.
This means that Kroki is never going away; anyone can host this service with minimal resource requirements.