---
title: "Import from Word plugin"
description: "Provides a way to import .docx (Microsoft Word documents) or .dotx (Microsoft Word templates) files into the editor."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/importword/"
md_url: "https://www.tiny.cloud/docs/tinymce/latest/importword/index.md"
version: "latest"
last_updated: "2026-05-24T22:45:03Z"
tokens: 2309
---
# Import from Word plugin

> **Note:** This plugin is only available as a [paid add-on](/tinymce/features/import-from-word/) to [a TinyMCE subscription](/pricing).
The Import from Word plugin lets you import `.docx` (Word document) or `.dotx` (Word template) files into the editor. The process preserves formatting and rich media.

## Interactive example

**Example**

```js
tinymce.init({
  selector: 'textarea#importword',
  height: '800px',
  plugins: [
    "importword", "advlist", "anchor", "autolink", "charmap", "code", "fullscreen",
    "help", "image", "insertdatetime", "link", "lists", "media",
    "preview", "searchreplace", "table", "visualblocks",
],
toolbar: "undo redo | importword | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
});
```

## Basic setup using the Tiny Cloud service

To add the Import from Word plugin to the editor, add `importword` to the `plugins` option in the editor configuration.

For example:

```js
tinymce.init({
  selector: 'textarea',
  plugins: 'importword',
  toolbar: 'importword',
  // Required for the cloud-based Import from Word plugin with Tiny Cloud
  // Create a JWT key in the Customer Portal for trial functionality to enable watermark-free exports during the trial period
  importword_token_provider: () => {
    return fetch('http://localhost:3000/jwt', { // specify your token endpoint
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
    }).then(response => response.json());
  },
});
```

> **Note:** For information on bundling this plugin with module bundlers, see [Bundling TinyMCE - Overview](../bundling-guide/).
For more infomation on the importword_token_provider option, see [importword_token_provider](#importword-token-provider).

> **Important:** The Import from Word plugin **requires** JWT authentication when using the Tiny Cloud service.
> 
> **Authentication Setup:**
> 
> 1. Create a JWT key in the Customer Portal
> 2. Configure the `importword_token_provider` option to specify the endpoint for retrieving your JWT token
> For more information on how to set up JWT authentication with Import from Word, see examples: [Import from Word with JWT authentication (Node.js)](../import-from-word-with-jwt-authentication-nodejs/) or [Import from Word with JWT authentication (PHP)](../import-from-word-with-jwt-authentication-php/)
> 
> **Trial period behavior**
> 
> - **Trial Period:**
> 
> - With JWT: Full functionality, unlimited usage, no watermarks.
> - Without JWT: Full functionality with watermarks and page limits.
> - **After Trial:**
> 
> - With Import from Word add-on + JWT: Full functionality (subscription-based)
> - Without add-on: Plugin entitlements are `disabled` and functionality is no longer available.
> Visit the [account portal](/auth/login/) to obtain your JWT key and test full functionality.

> **Note:** When using the cloud-hosted service behind a firewall or forward proxy, ensure `*.tiny.cloud` is allowlisted and that required HTTP headers are not stripped. See [Firewall and proxy allowlisting](../tinymce-and-csp/#firewall-and-proxy-allowlisting) for details.

## Basic setup using the self-hosted service

To use the self-hosted version of the Import from Word plugin, you need to set the `importword_service_url` option to the URL of the service.

Example:
```js
tinymce.init({
  selector: 'textarea',
  plugins: 'importword',
  toolbar: 'importword',
  importword_service_url: 'http://localhost:8080/' // Update with the URL of the service you are using such  as 'http://myserver.com/'
});
```

> **Important:** The `importword_service_url` option automatically appends `/v2/convert/docx-html` to the URL provided, so only the base URL is required. For example, if the service is hosted at `http://localhost:8080/v2/convert/docx-html`, the `importword_service_url` option should be set to `http://localhost:8080/`. When using in production, ensure that the `importword_service_url` is updated to the production URL such as `https://myserver.com/`.

## Options

The following configuration options affect the behavior of the Import from Word plugin.

### `importword_service_url`

The `importword_service_url` option sets the URL endpoint for the DOCX-to-HTML conversion service.

This option is **required** when configuring the Import from Word plugin for `on-premise` setups. If you require access to this feature, please [contact us](/contact/). For detailed instructions on deploying the Import from Word service server-side component using Docker, refer to the [on-premises documentation](../individual-import-from-word-and-export-to-word-on-premises/).

> **Tip:** When using a custom host, set the `importword_service_url` option in your TinyMCE configuration to match your host. For example, if your custom host is `mycustomhost.com`, set the URL to `https://mycustomhost.com/`.
**Type:** `String`

#### Example: Setting up `importword_service_url`

```js
tinymce.init({
  selector: 'textarea',
  plugins: 'importword',
  toolbar: 'importword',
  importword_service_url: '<service-URL>' // required for On-premise setups only
});
```

> **Important:**
> - If the `importword_service_url` option is **not configured**, a `console.error` will display: *The Import from Word plugin requires the `importword_service_url` to be configured*.
> - If the URL provided is invalid, a `console.error` will display: *The value provided in `importword_service_url` is not a valid URL*.

### `importword_token_provider`

The `importword_token_provider` option enables integration with a token-based authentication service for importing Word documents. It provides a mechanism to fetch an authentication token from a specified endpoint. This ensures that the import process can securely communicate with the server.

**Type:** `Function`

**Default value:** `undefined`

**Return data:** [`Token` object](#data-structure)

#### Example: using `importword_token_provider`

```js
tinymce.init({
  selector: 'textarea',
  plugins: 'importword',
  toolbar: 'importword',
  importword_token_provider: () => { // required when using the Import from Word plugin with Tiny Cloud.
    return fetch('http://localhost:3000/jwt', { // specify your token endpoint
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
    }).then(response => response.json());
  },
});
```

#### Data structure for the JWT token

The object containing the valid encoded token must match the following structure:

```js
{
  token: "<encoded JWT string>"
}
```

| Field | Type | Required? | Description |
| --- | --- | --- | --- |
| `token` | `string` | required | A Base64-encoded JSON Web Token (JWT) used for authentication and authorization. |

### `importword_converter_options`

**Type:** `String`

> **Note:** As of TinyMCE 7.5.0, the default value of the `importword_converter_options` setting has been updated to the following:
**Default value:**
```js
importword_converter_options: {
  formatting: {
    styles: 'inline',
    resets: 'inline',
    defaults: 'inline',
  }
}
```
The `importword_converter_options` setting allows you to customize the behavior of the Import from Word plugin when converting Word documents to HTML.

Example: using `importword_converter_options`
```js
tinymce.init({
  selector: 'textarea',
  plugins: 'importword',
  toolbar: 'importword',
  importword_service_url: '<service_URL>', // required if using On-premises service
  importword_converter_options: {
    formatting: {
      resets: 'inline',
      defaults: 'inline',
      styles: 'none',
    }
  }
});
```

> **Note:** For more information on the available converter options, refer to the [Import from Word API documentation](https://importdocx.api.tiny.cloud/v2/convert/docs#section/Import-from-Word/Configuration).

## Toolbar buttons

The Import from Word plugin provides the following toolbar buttons:

| Toolbar button identifier | Description |
| --- | --- |
| `importword` | Opens the import dialog so the user can select a specific `.docx` or `.dotx` file. |

These toolbar buttons can be added to the editor using:

- The [`toolbar`](../toolbar-configuration-options/#toolbar) configuration option.
- The [`quickbars_insert_toolbar`](../quickbars/#quickbars_insert_toolbar) configuration option.
- [Custom Context toolbars](../contexttoolbar/).

## Menu items

The Import from Word plugin provides the following menu items:

| Menu item identifier | [Default Menu Location](../menus-configuration-options/#example-the-tinymce-default-menu-items) | Description |
| --- | --- | --- |
| `importword` | File | Opens the import dialog so the user can select a specific `.docx` or `.dotx` file. |

These menu items can be added to the editor using:

- The [`menu`](../menus-configuration-options/#menu) configuration option.
- The [`contextmenu`](../menus-configuration-options/#contextmenu) configuration option.
- [Custom Menu toolbar buttons](../custom-menu-toolbar-button/).

## Commands

The Import from Word plugin provides the following TinyMCE commands.

| Command | Description |
| --- | --- |
| ImportWord | Opens a file picker, that allows content from either a `.docx` or `.dotx` file to be imported into the editor. |

Example
```js
document.querySelector('button').addEventListener('click',
  () => tinymce.activeEditor.execCommand('ImportWord')
);
```

> **Note:** The `ImportWord` command cannot be directly invoked through a script at the top level or from the browser console. Instead, it necessitates a specific user action within the user interface, such as clicking a toolbar button. To ensure correct execution, the command should be called within the scope of an event handler tied to a specific user interaction, as shown in the example.

## API Reference

> Explore the comprehensive API documentation for the Import from Word Premium plugin at [Import from Word API Reference Documentation.](https://importdocx.api.tiny.cloud/v2/convert/docs#section/Import-from-Word)
