# Enhanced paste from Office

The enhanced paste from Office feature lets you paste content from Microsoft Word and Excel while retaining more of the original formatting than the [standard paste from Office](paste-from-office.md) feature.

> **Unlock this feature with selected CKEditor Plans**
>
> Try all premium features – no credit card needed.
>
> [Sign up for a free trial ](https://portal.ckeditor.com/checkout?plan=free)[Select a Plan](https://ckeditor.com/pricing/)

There is also the [basic, open-source Paste from Office](paste-from-office.md) feature. You can read more about the differences between these two [further in this guide](#content-formatting-support).

<a id="demo">

## Demo

Use these sample documents to test pasting from Microsoft Office:

* [Sample Word document](https://ckeditor.com/docs/ckeditor5/latest/assets/PasteFromOfficeEnhancedWordSample.docx)
* [Sample Excel spreadsheet](https://ckeditor.com/docs/ckeditor5/latest/assets/PasteFromOfficeEnhancedExcelSample.xlsx)

To test pasting from Office, download the sample documents and open them in Microsoft Office applications. Then, copy the content and paste it into the editor below.

<!-- AI-AGENT-NOTE: An interactive demo is embedded here but is not represented in this Markdown file. If you need to see it in action, open this page in a browser (e.g. via a browser-automation MCP like Chrome DevTools or Playwright), or let the user know a live demo is available on this page. -->

This demo presents a limited set of features. Visit the [feature-rich editor example](../../examples/builds-custom/full-featured-editor.md) to see more in action.

<a id="content-formatting-support">

## Content formatting support

Enhanced paste from Office retains rich content pasted from Microsoft Office applications. See below the full table of supported styles and formatting.

<a id="microsoft-word">

### Microsoft Word

The name of each group in the table corresponds to the category in Word’s “Modify style” user interface. If a specific formatting is supported natively (without using the [General HTML Support](#installation) feature), a plugin name responsible for the formatting is provided in parentheses.

> **Warning**
>
> The basic **paste from Office** feature only supports inline formatting, introduced via the Microsoft Word user interface. It does not support Word styles.
>
> The **enhanced paste from Office** feature supports both.

| Group                       | Formatting                             | Paste from Office                   | Premium feature Enhanced paste from Office                 |                                                        |
| --------------------------- | -------------------------------------- | ----------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------ |
|                             |                                        |                                     | Native support                                             | With [General HTML Support](#installation)             |
| Font                        | Font family                            | ✅ Yes                               | ✅ Yes (`FontFamily`)                                       | ✅ Yes                                                  |
|                             | Font style (weight, italic)            | ✅ Yes                               | ✅ Yes (`Bold`, `Italic`)                                   | ✅ Yes                                                  |
|                             | Font size                              | ✅ Yes                               | ✅ Yes (`FontSize`)                                         | ✅ Yes                                                  |
|                             | Text color                             | ✅ Yes                               | ✅ Yes (`FontColor`)                                        | ✅ Yes                                                  |
|                             | Underline                              | ✅ Yes                               | ✅ Yes (`Underline`) [\[1\]](#word-font-underline-color)    | ✅ Yes [\[1\]](#word-font-underline-color)              |
|                             | Advanced underline                     | ❌ No                                | ✅ Yes (`Underline`) [\[2\]](#word-font-underline-advanced) | ✅ Yes [\[2\]](#word-font-underline-advanced)           |
|                             | Emphasis mark                          | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Strikethrough                          | ✅ Yes                               | ✅ Yes (`Strikethrough`)                                    | ✅ Yes                                                  |
|                             | Double strikethrough                   | ❌ No                                | ✅ Yes (`Strikethrough`) [\[3\]](#word-font-strike)         | ✅ Yes (`Strikethrough`) [\[3\]](#word-font-strike)     |
|                             | Superscript                            | ✅ Yes                               | ✅ Yes (`Superscript`)                                      | ✅ Yes                                                  |
|                             | Subscript                              | ✅ Yes                               | ✅ Yes (`Subscript`)                                        | ✅ Yes                                                  |
|                             | Small caps                             | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | All caps                               | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Hidden                                 | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Character scale                        | ❌ No                                | ❌ No                                                       | ❌ No                                                   |
|                             | Character spacings                     | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Advanced typography                    | ❌ No                                | ❌ No                                                       | ❌ No                                                   |
| Paragraph                   | Alignment                              | ✅ Yes                               | ✅ Yes (`Alignment`)                                        | ✅ Yes                                                  |
|                             | Indentation left                       | ✅ Yes                               | ✅ Yes (`IndentBlock`)                                      | ✅ Yes                                                  |
|                             | Indentation right                      | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Spacing before                         | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Spacing after                          | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Line spacing                           | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Line spacing at                        | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | No space between same–style paragraphs | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
| Tabs                        | Alignment                              | ❌ No                                | ✅ Yes [\[4\]](#word-tabs)                                  | ✅ Yes [\[4\]](#word-tabs)                              |
|                             | Leader                                 | ❌ No                                | ✅ Yes [\[4\]](#word-tabs)                                  | ✅ Yes [\[4\]](#word-tabs)                              |
| Borders and shading         | Style                                  | ❌ No                                | ❌ No                                                       | ✅ Yes [\[5\]](#word-border-style)                      |
|                             | Color                                  | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Width                                  | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Side                                   | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | From text                              | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Fill                                   | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
|                             | Pattern style                          | ❌ No                                | ❌ No                                                       | ✅ Yes [\[6\]](#word-borders-and-shading-pattern-style) |
|                             | Pattern color                          | ❌ No                                | ❌ No                                                       | ✅ Yes                                                  |
| Language                    | Language                               | ❌ No                                | ✅ Yes (`TextPartLanguage`)                                 | ✅ Yes                                                  |
|                             | Do not check spelling                  | ❌ No                                | ❌ No                                                       | ❌ No                                                   |
| Frame                       | Text wrapping                          | ❌ No                                | ❌ No                                                       | ❌ No                                                   |
|                             | Size                                   | ❌ No                                | ❌ No                                                       | ❌ No                                                   |
|                             | Horizontal                             | ❌ No                                | ❌ No                                                       | ❌ No                                                   |
|                             | Vertical                               | ❌ No                                | ❌ No                                                       | ❌ No                                                   |
| Bullet points and Numbering | General                                | ✅ Yes (`List`) [\[7\]](#word-lists) | ✅ Yes (`List`) [\[7\]](#word-lists)                        | ✅ Yes [\[7\]](#word-lists)                             |

> **Note**
>
> * \[1] Underline color is ignored.
> * \[2] Pasted as simple underline
> * \[3] Pasted as single strikethrough.
> * \[4] Tabs are non-interactive.
> * \[5] Not all Word border styles have CSS counterparts.
> * \[6] The overall density is preserved but the pattern details are lost.
> * \[7] Partial support.

<a id="microsoft-excel">

### Microsoft Excel

The name of each group in the table corresponds to the category in the Excel “Format cells” user interface. If a specific formatting is supported natively (without using the [General HTML Support](#installation) feature), a plugin name responsible for the formatting is provided in parentheses.

| Group     | Formatting                       | Paste from Office | Premium feature Enhanced paste from Office                       |                                            |
| --------- | -------------------------------- | ----------------- | ---------------------------------------------------------------- | ------------------------------------------ |
|           |                                  |                   | Native support                                                   | With [General HTML Support](#installation) |
| Alignment | Horizontal alignment             | ❌ No              | ✅ Yes (`TableCellProperties`)                                    | ✅ Yes                                      |
|           | Vertical alignment               | ❌ No              | ✅ Yes (`TableCellProperties`)                                    | ✅ Yes                                      |
|           | Indent                           | ❌ No              | ✅ Yes (`TableCellProperties`)                                    | ✅ Yes                                      |
|           | Orientation (angle)              | ❌ No              | ❌ No                                                             | ❌ No                                       |
| Font      | Family                           | ❌ No              | ✅ Yes (`FontFamily`)                                             | ✅ Yes                                      |
|           | Style                            | ❌ No              | ✅ Yes (`Bold`, `Italic`)                                         | ✅ Yes                                      |
|           | Size                             | ❌ No              | ✅ Yes (`FontSize`)                                               | ✅ Yes                                      |
|           | Underline                        | ❌ No              | ✅ Yes (`Underline`)                                              | ✅ Yes                                      |
|           | Advanced underline (like double) | ❌ No              | ❌ No                                                             | ❌ No                                       |
|           | Color                            | ❌ No              | ✅ Yes (`FontColor`)                                              | ✅ Yes                                      |
|           | Strikethrough                    | ❌ No              | ✅ Yes (`Strikethrough`)                                          | ✅ Yes                                      |
|           | Superscript                      | ❌ No              | ✅ Yes (`Superscript`)                                            | ✅ Yes                                      |
|           | Subscript                        | ❌ No              | ✅ Yes (`Subscript`)                                              | ✅ Yes                                      |
| Border    | Border color                     | ❌ No              | ✅ Yes (`TableCellProperties`)                                    | ✅ Yes                                      |
|           | Border width                     | ❌ No              | ✅ Yes (`TableCellProperties`)                                    | ✅ Yes                                      |
|           | Border style                     | ❌ No              | ✅ Yes [\[1\]](#excel-border-style)                               | ✅ Yes [\[1\]](#excel-border-style)         |
|           | Borders across cell (diagonal)   | ❌ No              | ❌ No                                                             | ❌ No                                       |
| Fill      | Background                       | ❌ No              | ✅ Yes (`TableCellProperties`)                                    | ✅ Yes                                      |
|           | Pattern color                    | ❌ No              | ✅ Yes (`TableCellProperties`) [\[2\]](#excel-fill-pattern-color) | ✅ Yes [\[2\]](#excel-fill-pattern-color)   |
|           | Pattern style                    | ❌ No              | ❌ No                                                             | ❌ No                                       |

> **Note**
>
> * \[1] Not all Excel border styles have CSS counterparts.
> * \[2] It overrides the cell background.

<a id="support-for-other-office-applications">

## Support for other office applications

At the current stage, the focus of `@ckeditor/ckeditor5-paste-from-office` and `@ckeditor/ckeditor5-paste-from-office-enhanced` packages is on supporting content that comes from Microsoft Word, Microsoft Excel, and [Google Docs](paste-from-google-docs.md). However, it does not mean that pasting from other similar applications (such as Microsoft PowerPoint) is not supported.

By default, CKEditor 5 will support pasting rich-text content from these applications, however, some styles and formatting may be lost, depending on the source application. Also, other minor bugs may appear.

You can find more information about compatibility with other applications in [this ticket](https://github.com/ckeditor/ckeditor5/issues/1184#issuecomment-409828069).

If you think that support for any of the applications needs improvements, add 👍 and comments in the following issues:

* [Support pasting from Libre Office](https://github.com/ckeditor/ckeditor5/issues/2520).
* [Support pasting from Pages](https://github.com/ckeditor/ckeditor5/issues/2527).

Feel free to open a [new feature request](https://github.com/ckeditor/ckeditor5/issues/new/choose) for other similar applications, too!

<a id="installation">

## Installation

To add the enhanced paste from Office feature to your editor, you need to install [basic, open-source paste from Office](paste-from-office.md), enhanced paste from Office and [General HTML Support](../html/general-html-support.md) plugins. The `GeneralHtmlSupport` plugin is optional but recommended for optimal retention and accuracy of pasted styles. [Learn more](#configuration).

We highly recommend you also add other editor packages to get as much native support for pasted content as possible. You can learn more about editor features that work out–of–the–box with content pasted from Microsoft Office in a [dedicated section](#content-formatting-support). To install the recommended packages, execute the following command:

Add the `PasteFromOffice`, `PasteFromOfficeEnhanced`, and `GeneralHtmlSupport` plugins to your plugin list as well as other editor features that support content pasted from Microsoft Office (`Bold`, `Italic`, `FontColor`, `Indent`, etc.):

**NPM**

```js
import {
	ClassicEditor,
	PasteFromOffice,
	GeneralHtmlSupport,
	Alignment,
	Bold,
	Italic,
	Underline,
	Strikethrough,
	Subscript,
	Superscript,
	FontColor,
	FontBackgroundColor,
	FontFamily,
	FontSize,
	Indent,
	Table,
	TableProperties,
	TableCellProperties,
	TextPartLanguage
} from 'ckeditor5';
import { PasteFromOfficeEnhanced } from 'ckeditor5-premium-features';

// Other imports...

ClassicEditor
	.create( {
		licenseKey: '<YOUR_LICENSE_KEY>',
		plugins: [
			// Load the open-source feature.
			PasteFromOffice,

			// Load the enhanced feature.
			PasteFromOfficeEnhanced,

			// Load the recommended General HTML Support feature.
			GeneralHtmlSupport,

			// Load other recommended editor features.
			Alignment, Bold, Italic, Underline, Strikethrough, Subscript, Superscript,
			FontColor, FontBackgroundColor, FontFamily, FontSize, Indent,
			Table, TableProperties, TableCellProperties,
			TextPartLanguage,

			/* ... */
		],

		// See the "Configuration" section below to learn how to configure
		// the editor for the best performance.
		// ...
	} )
	.then( /* ... */ )
	.catch( /* ... */ );
```

**CDN**

```js
const {
	ClassicEditor,
	PasteFromOffice,
	GeneralHtmlSupport,
	Alignment,
	Bold,
	Italic,
	Underline,
	Strikethrough,
	Subscript,
	Superscript,
	FontColor,
	FontBackgroundColor,
	FontFamily,
	FontSize,
	Indent,
	Table,
	TableProperties,
	TableCellProperties,
	TextPartLanguage
} = CKEDITOR;
const { PasteFromOfficeEnhanced } = CKEDITOR_PREMIUM_FEATURES;

// Other imports...

ClassicEditor
	.create( {
		licenseKey: '<YOUR_LICENSE_KEY>',
		plugins: [
			// Load the open-source feature.
			PasteFromOffice,

			// Load the enhanced feature.
			PasteFromOfficeEnhanced,

			// Load the recommended General HTML Support feature.
			GeneralHtmlSupport,

			// Load other recommended editor features.
			Alignment, Bold, Italic, Underline, Strikethrough, Subscript, Superscript,
			FontColor, FontBackgroundColor, FontFamily, FontSize, Indent,
			Table, TableProperties, TableCellProperties,
			TextPartLanguage,

			/* ... */
		],

		// See the "Configuration" section below to learn how to configure
		// the editor for the best performance.
		// ...
	} )
	.then( /* ... */ )
	.catch( /* ... */ );
```

Finally, [update the configuration](#configuration).

<a id="activating-the-feature">

## Activating the feature

To use this premium feature, you need to activate it with proper credentials. Refer to the [License key and activation](../../getting-started/licensing/license-key-and-activation.md) guide for details.

<a id="configuration">

## Configuration

Enhanced paste from Office does not come with its own configuration. Still, we highly recommend to load and configure other editor features in a certain way for optimal retention and performance of pasted styles:

* [General HTML Support](../html/general-html-support.md) – Enabling and [configuring](../html/general-html-support.md#enabling-all-html-features) this feature will allow you to make the most of the enhanced paste from Office by retaining advanced formatting that would otherwise be rejected by core editor features. See the [content compatibility table](#content-formatting-support) to learn more.
* [Font size and family](../font.md) – Loading and configuring these features will ensure maximal compatibility of fonts in the pasted content.

The recommended configuration is as follows:

**NPM**

```js
import {
	ClassicEditor,
	PasteFromOffice,
	GeneralHtmlSupport,
	Alignment,
	Bold,
	Italic,
	Underline,
	Strikethrough,
	Subscript,
	Superscript,
	FontColor,
	FontBackgroundColor,
	FontFamily,
	FontSize,
	Indent,
	Table,
	TableProperties,
	TableCellProperties,
	TextPartLanguage
} from 'ckeditor5';
import { PasteFromOfficeEnhanced } from 'ckeditor5-premium-features';

// Other imports...

ClassicEditor
	.create( {
		licenseKey: '<YOUR_LICENSE_KEY>',
		plugins: [
			// Load the open-source feature.
			PasteFromOffice,

			// Load the enhanced feature.
			PasteFromOfficeEnhanced,

			// Load the recommended General HTML Support feature.
			GeneralHtmlSupport,

			// Load other recommended editor features.
			Alignment, Bold, Italic, Underline, Strikethrough, Subscript, Superscript,
			FontColor, FontBackgroundColor, FontFamily, FontSize, Indent,
			Table, TableProperties, TableCellProperties,
			TextPartLanguage,

			/* ... */
		],

		// Configuration of the GeneralHtmlSupport plugin to allow extra content
		// into the editor. This configuration will preserve styles and formatting
		// normally unsupported by core editor features.
		htmlSupport: {
			allow: [
				{
					name: /^.*$/,
					styles: true,
					attributes: true,
					classes: true
				}
			]
		},

		// Configuration of the FontFamily plugin.
		fontFamily: {
			// Allow all fonts from Microsoft Office documents
			// including those that are unknown to CKEditor.
			supportAllValues: true
		},

		// Configuration of the FontSize plugin.
		fontSize: {
			options: [
				8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
			],

			// Allow all font sizes from Microsoft Office documents
			// including those that are unknown to CKEditor.
			supportAllValues: true
		},

		// Add UI buttons and dropdowns for extra editor features
		// if you used the feature set from "Installation" section.
		toolbar: [
			// ...
			'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',
			'|',
			'alignment', 'outdent', 'indent',
			'|',
			'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor',
			'|',
			'insertTable',
			'|',
			'textPartLanguage',
			// ...
		],

		// Add UI buttons and dropdowns for extra table features
		// if you used the feature set from "Installation" section.
		table: {
			contentToolbar: [
				'tableColumn', 'tableRow', 'mergeTableCells',
				'|',
				'tableProperties', 'tableCellProperties'
			]
		},

		// ...
	} )
	.then( /* ... */ )
	.catch( /* ... */ );
```

**CDN**

```js
const {
	ClassicEditor,
	PasteFromOffice,
	GeneralHtmlSupport,
	Alignment,
	Bold,
	Italic,
	Underline,
	Strikethrough,
	Subscript,
	Superscript,
	FontColor,
	FontBackgroundColor,
	FontFamily,
	FontSize,
	Indent,
	Table,
	TableProperties,
	TableCellProperties,
	TextPartLanguage
} = CKEDITOR;
const { PasteFromOfficeEnhanced } = CKEDITOR_PREMIUM_FEATURES;

// Other imports...

ClassicEditor
	.create( {
		licenseKey: '<YOUR_LICENSE_KEY>',
		plugins: [
			// Load the open-source feature.
			PasteFromOffice,

			// Load the enhanced feature.
			PasteFromOfficeEnhanced,

			// Load the recommended General HTML Support feature.
			GeneralHtmlSupport,

			// Load other recommended editor features.
			Alignment, Bold, Italic, Underline, Strikethrough, Subscript, Superscript,
			FontColor, FontBackgroundColor, FontFamily, FontSize, Indent,
			Table, TableProperties, TableCellProperties,
			TextPartLanguage,

			/* ... */
		],

		// Configuration of the GeneralHtmlSupport plugin to allow extra content
		// into the editor. This configuration will preserve styles and formatting
		// normally unsupported by core editor features.
		htmlSupport: {
			allow: [
				{
					name: /^.*$/,
					styles: true,
					attributes: true,
					classes: true
				}
			]
		},

		// Configuration of the FontFamily plugin.
		fontFamily: {
			// Allow all fonts from Microsoft Office documents
			// including those that are unknown to CKEditor.
			supportAllValues: true
		},

		// Configuration of the FontSize plugin.
		fontSize: {
			options: [
				8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
			],

			// Allow all font sizes from Microsoft Office documents
			// including those that are unknown to CKEditor.
			supportAllValues: true
		},

		// Add UI buttons and dropdowns for extra editor features
		// if you used the feature set from "Installation" section.
		toolbar: [
			// ...
			'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',
			'|',
			'alignment', 'outdent', 'indent',
			'|',
			'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor',
			'|',
			'insertTable',
			'|',
			'textPartLanguage',
			// ...
		],

		// Add UI buttons and dropdowns for extra table features
		// if you used the feature set from "Installation" section.
		table: {
			contentToolbar: [
				'tableColumn', 'tableRow', 'mergeTableCells',
				'|',
				'tableProperties', 'tableCellProperties'
			]
		},

		// ...
	} )
	.then( /* ... */ )
	.catch( /* ... */ );
```

<a id="known-issues">

## Known issues

* There is a known issue with cell widths being incorrect upon pasting from Microsoft Excel. [Learn more](https://github.com/ckeditor/ckeditor5/issues/14521).
* Headings pasted from Microsoft Word with a normal font weight configured in styles will be rendered using a bold font due to the default style sheets provided by the editor.
* A bold text pasted from Microsoft Excel may be occasionally displayed as normal for specific font faces.
* There is a known issue with font family, font size, and text part language values being displayed incorrectly in the CKEditor UI.

<a id="related-features">

## Related features

CKEditor 5 supports a wider range of paste features, including:

* [Paste from Office](paste-from-office.md) – Basic, open-source version of the paste from Office plugin.
* [Paste from Google Docs](paste-from-google-docs.md) – Paste content from Google Docs, maintaining the original formatting and structure.
* [Paste plain text](paste-plain-text.md) – Paste text without formatting that will inherit the style of the content it was pasted into.
* [Import from Word](../converters/import-word/import-word.md) – Convert Word files directly into HTML content. You can read more about the differences between the paste from Office and import from Word features in the [dedicated comparison guide](../converters/import-word/features-comparison.md).

---

Full index of the CKEditor 5 documentation: [llms.txt](../../../llms.txt)
