Skip to main content

What is Portable Text?

Portable Text is Sanity’s rich text format—a structured, JSON-based way to represent content that’s more powerful and flexible than HTML. Unlike HTML (which mixes content and presentation), Portable Text separates what the content is from how it looks. This makes your content:
  • Platform-agnostic - Render on web, mobile, email, or anywhere
  • Structured - Query and filter content programmatically
  • Customizable - Style differently across platforms
  • Future-proof - Not tied to specific HTML/CSS

Portable Text Structure

Portable Text is an array of blocks and marks:
This represents:

Key Concepts

Blocks

Blocks are the main content units:
  • Paragraphs - style: "normal"
  • Headings - style: "h1" through style: "h6"
  • Lists - listItem: "bullet" or listItem: "number"
  • Custom blocks - Images, code, embeds, etc.

Marks

Marks are inline annotations:
  • strong - Bold text
  • em - Italic text
  • underline - Underlined text
  • code - Inline code
  • link - Hyperlinks with href

Spans

Spans are text segments within blocks, each with its own marks.

How MigrateKit Converts HTML

When you migrate from Webflow, MigrateKit transforms HTML to Portable Text:
Learn more: HTML Conversion

Benefits for Migration

Preservation of Structure

HTML tags become semantic blocks:

Platform Flexibility

Render Portable Text differently on different platforms:
All from the same Portable Text source!

Querying and Filtering

Find content programmatically:
You can’t do this easily with HTML.

Editing Portable Text

In Sanity Studio, Portable Text appears as a rich text editor: Editors see familiar formatting options:
  • Bold, italic, underline buttons
  • Heading dropdown
  • List buttons
  • Link insertion
  • Undo/redo
But behind the scenes, it’s all stored as structured Portable Text.

Custom Block Types

Portable Text isn’t limited to text—you can embed custom content:
This allows rich, interactive content while keeping structure.

Why This Matters for Webflow Migrations

From HTML Chaos to Structured Content

Webflow stores rich text as HTML—a mix of content, structure, and styling. Portable Text separates these concerns:

Better Content Management

  • Cleaner - No HTML tag soup
  • Safer - No script injection risks
  • Flexible - Render anywhere, any way
  • Searchable - Query content semantically

Common Questions

Yes! Sanity supports HTML in Portable Text through custom serializers. But you lose some benefits:
  • Can’t query HTML content semantically
  • Platform-specific rendering is harder
  • Less structured
MigrateKit converts HTML to Portable Text to give you maximum flexibility.
MigrateKit handles most common HTML tags, but complex structures may need manual cleanup:
  • Custom Webflow elements → Code blocks (review in Studio)
  • Nested formatting → Simplified to Portable Text rules
  • Unsupported tags → Wrapped for safety
See HTML Conversion for details.
In Sanity Studio, you edit using the rich text editor (WYSIWYG). To see the raw Portable Text JSON, use Sanity’s Vision plugin.You typically don’t need to edit Portable Text as JSON—the editor handles it.
Portable Text is an open specification created by Sanity. While Sanity uses it extensively, you can use Portable Text in any system. It’s just JSON!