The Clipboard API provides the ability to respond to clipboard commands (cut, copy, and paste) as well as to asynchronously read from and write to the system clipboard. Access to the contents of the clipboard is gated behind the Permissions API; without user permission, reading or altering the clipboard contents is not permitted.

This API is designed to supersede accessing the clipboard using document.execCommand()

Accessing the clipboard

Instead of creating a Clipboard object through instantiation, you access the system clipboard through the Navigator.clipboard global:

navigator.clipboard.readText().then(
  clipText => document.queryElementSelector(".editor").innerText += clipText);

This snippet fetches the text from the clipboard and appends it to the first element found with the class "editor". Since readText() (and read(), for that matter) returns an empty string if the clipboard isn't text, this code is safe.

Interfaces

Clipboard Secure context
Provides an interface for reading and writing text and data to or from the system clipboard. The specification refers to this as the 'Async Clipboard API.'
ClipboardEvent Secure context
Represents events providing information related to modification of the clipboard, that is cut, copy, and paste events. The specification refers to this as the 'Clipboard Event API'.

Specifications

Specification Status Comment
Clipboard API and events Working Draft Initial definition.

Browser compatibility

Clipboard

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 66Edge ? Firefox Full support 63IE ? Opera Full support 53Safari ? WebView Android No support NoChrome Android Full support 66Edge Mobile ? Firefox Android Full support 63Opera Android Full support 53Safari iOS ? Samsung Internet Android ?
readChrome No support NoEdge ? Firefox Full support 63
Notes Disabled
Full support 63
Notes Disabled
Notes Currently works just like readText(); non-text content is not currently supported.
Disabled From version 63: this feature is behind the dom.events.asyncClipboard.dataTransfer preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE ? Opera No support NoSafari ? WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 63
Notes Disabled
Full support 63
Notes Disabled
Notes Currently works just like readText(); non-text content is not currently supported.
Disabled From version 63: this feature is behind the dom.events.asyncClipboard.dataTransfer preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS ? Samsung Internet Android ?
readTextChrome Full support 66Edge ? Firefox Full support 63
Notes
Full support 63
Notes
Notes Firefox only supports reading the clipboard in browser extensions, using the "clipboardRead" extension permission.
IE ? Opera Full support 53Safari ? WebView Android No support NoChrome Android Full support 66Edge Mobile ? Firefox Android Full support 63
Notes
Full support 63
Notes
Notes Firefox only supports reading the clipboard in browser extensions, using the "clipboardRead" extension permission.
Opera Android Full support 53Safari iOS ? Samsung Internet Android ?
writeChrome No support NoEdge ? Firefox Full support 63
Notes Disabled
Full support 63
Notes Disabled
Notes Currently works exactly like writeText(), including the availability limitations currently imposed by Firefox.
Disabled From version 63: this feature is behind the dom.events.asyncClipboard.dataTransfer preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE ? Opera No support NoSafari ? WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 63
Notes Disabled
Full support 63
Notes Disabled
Notes Currently works exactly like writeText(), including the availability limitations currently imposed by Firefox.
Disabled From version 63: this feature is behind the dom.events.asyncClipboard.dataTransfer preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS ? Samsung Internet Android ?
writeTextChrome Full support 66Edge ? Firefox Full support 63
Notes
Full support 63
Notes
Notes Writing to the clipboard is available without permission in secure contexts and browser extensions, but only from user-initiated event callbacks. Browser extensions with the "clipboardWrite" permission can write to the clipboard at any time.
IE ? Opera Full support 53Safari ? WebView Android No support NoChrome Android Full support 66Edge Mobile ? Firefox Android Full support 63
Notes
Full support 63
Notes
Notes Writing to the clipboard is available without permission in secure contexts and browser extensions, but only from user-initiated event callbacks. Browser extensions with the "clipboardWrite" permission can write to the clipboard at any time.
Opera Android Full support 53Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

ClipboardEvent

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
Experimental
Chrome Full support YesEdge Full support YesFirefox Full support YesIE Full support 4Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
ClipboardEvent() constructor
Experimental
Chrome Full support 58Edge ? Firefox Full support YesIE ? Opera Full support 45Safari ? WebView Android Full support 58Chrome Android Full support 58Edge Mobile ? Firefox Android Full support YesOpera Android Full support 45Safari iOS ? Samsung Internet Android ?
clipboardData
Experimental
Chrome Full support YesEdge Full support YesFirefox Full support 22IE Full support 5Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 22Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

Document Tags and Contributors

Contributors to this page: fscholz, Sheppy, raghav710, jpmedley
Last updated by: fscholz,