Write a Slack bot message in an editor and get a Slack-style preview with Block Kit JSON, chat.postMessage curl, Node.js, Python and incoming webhook code ready to paste. Handles mrkdwn formatting, mention and link escaping, and Block Kit limit checks. No login and no token needed, and nothing you write is sent to a server.
headersectionsection · fieldsactionscontextUsed in notifications, lock screens and screen readers.
Runs in your browser: what you enter is never uploaded.
v2.4.0An approximation for checking structure. Real rendering varies by Slack client and theme.
Open in Block Kit Builder ↗Opens the Slack site in a new tab with the block JSON in the address.
A message sent through the Slack API has a top-level `text` and a `blocks` array. Each item in `blocks` is one visual chunk, and this tool maps the common ones to editor blocks: text is a `section`, a header is `header`, a rule is `divider`, two-column key-value pairs are `section` `fields`, small grey text is `context`, a row of buttons is `actions`, and a single button beside text is a `section` `accessory`.
A message can hold up to 50 blocks, and each block has its own character limits: 3,000 for section text, 10 fields of 2,000 characters each, 150 for a header and 75 for button text. Slack rejects requests that go over, so the tool flags the block right away and lists the problem under the output.
In mrkdwn, Slack's message format, bold is `*text*` with a single asterisk, italic is `_text_` and strikethrough is `~text~`. Writing `**bold**` as in Markdown shows the asterisks. Links are wrapped in angle brackets as `<https://example.com|label>`, user mentions as `<@U0123456789>` and channels as `<#C0123456789>`. There is no list syntax, so put a `•` at the start of each line.
Because angle brackets have meaning, `&`, `<` and `>` in your text must be sent as `&`, `<` and `>`. The tool escapes only the characters you typed and leaves link, mention and date tokens from the toolbar alone, so a sentence like `a < b` and a `<@U0123456789>` mention can sit in the same text and both render as intended.
chat.postMessage is called with a bot token (`xoxb-`) and takes a channel ID in `channel`, so you can post anywhere the bot has access. It returns the message `ts`, which you need for thread replies and later edits. An incoming webhook is a single URL created in the app settings that posts to one fixed channel. You cannot change its channel, icon or name, but there is no token to manage.
Both the token and the webhook URL are secrets. The generated code reads them from the `SLACK_BOT_TOKEN` and `SLACK_WEBHOOK_URL` environment variables, and the page has no token field, so you never get into the habit of pasting real tokens into a browser tool.
The link button has a `url`, and the roll back button has an `action_id` and `value`. Buttons whose clicks you handle need Interactivity enabled in the app and a server to receive the request.
Mentions need the member ID, not the display name, to notify anyone. Use "Copy member ID" in the Slack profile to get it.
Without escaping, Slack tries to read what follows `<` as a link or mention token and part of the sentence can disappear.
What it is, who it's for, how it works and why you'd use it.
A Slack Message Builder turns a Slack bot message written in an editor into Block Kit JSON and API call code for curl, Node.js, Python and incoming webhooks.
It is for developers building deploy and incident alert bots, PMs running release note and announcement bots, and anyone adding Slack notifications to internal automation.
You stack blocks such as headers, text, fields and buttons and add mrkdwn formatting from a toolbar. Each block is serialized to one Block Kit block with special characters escaped and limits checked, and the payload is placed into call code for each language.
It avoids the quoting, escaping and limit errors that come from writing Block Kit JSON by hand, and gives you code you can paste right away without logging in.