How to move code snippets, logs or config text from your phone to your computer
In short
Code breaks in transit for predictable reasons: curly quotes from the phone keyboard, lost indentation, changed line endings, or truncated logs. Turn off smart punctuation, send logs as a file, check the result with a diff, and never send tokens, keys or passwords through any online clipboard.
Last updated
Prose survives being copied between devices; code often doesn't. A YAML file loses one level of indentation, a shell command gains a curly quote, a JSON log gets cut in half, and suddenly nothing parses. This guide is about the developer-specific problems. For the general ways to get text from a phone to a computer, see copying text between phone and computer.
The usual ways code gets damaged
Smart quotes and dashes
Phone keyboards “helpfully” turn straight quotes into curly ones and double hyphens into dashes. That breaks strings, flags like --force and most config formats. On an iPhone, the setting is called Smart Punctuation and lives in the keyboard settings (Apple: iPhone keyboard). On Android with Gboard, auto-correction and related options are under text correction in Gboard's settings (Gboard Help). Turning them off only affects what you type from now on; text that was already converted stays converted.
Auto-correct and auto-capitalisation
Typing code on a phone keyboard is risky in itself: variable names get “corrected”, the first letter of a command gets capitalised. Copy code from its source rather than retyping it, and paste it into a field that doesn't reformat text.
Indentation and line endings
Chat apps and some note apps trim leading spaces or merge lines. Windows also uses a different line ending (CRLF) from macOS, Linux and phones (LF); when text is pasted on Windows it often arrives with CRLF endings. Most editors handle both, but shell scripts and some diff tools don't. If a script fails with odd errors after the transfer, convert the line endings in your editor.
A method that keeps text exactly
- On the phone, copy the snippet from where it lives (the app, the log viewer, the documentation).
- Paste it into Online Clipboard and create a clip. Line breaks, tabs and spaces are stored as they are, and the text is shown in a monospace font on the receiving side.
- On the computer, enter the code and use the Copy text button rather than selecting the text by hand.
- Paste it into your editor and check it. For anything longer than a few lines, compare it with a diff.
A clip takes up to 100,000 characters of text and expires after 30 minutes. For a one-off, nothing has to be installed or signed in to on either side.
Check that it arrived intact
For a short snippet, a glance is enough. For a config file or a long script, compare it properly: count the lines on both sides, or compare a checksum of the file. sha256sum file on Linux, shasum -a 256 file on macOS and Get-FileHash file in Windows PowerShell all print a SHA-256 hash; if the hashes match, the bytes match. Different line endings change the hash, so normalise them first if you compare across systems.
Large logs
- Trim first: the last few hundred lines around the error are usually all anyone needs.
- For a full log, send it as a file rather than pasted text. Compress it into a ZIP; text logs shrink well, unlike photos or videos. A clip takes one file of up to 25 MB.
- Logs from phones are often noisy. Search for the error timestamp before sharing everything.
Never send secrets through any online clipboard
API keys, access tokens, passwords, private keys, .env files, database connection strings and session cookies must never go through an online clipboard, ours included. Text and files travel over HTTPS, but they are not end-to-end encrypted. Until a clip expires, it sits on our servers and our hosting providers' servers, so the people running the service could technically access it. Logs are the sneaky case: they often contain tokens, internal URLs or customers' email addresses. Redact them before sending, and if a secret slips through, rotate it rather than hoping nobody saw it.
When this tool is not the right choice
- Secrets of any kind: use your password manager or your platform's secret store, and rotate anything that leaked.
- Code you want to keep or share with a team: commit it to your repository or a private gist; a clip is gone after 30 minutes.
- Logs bigger than 25 MB even after zipping: attach them to the issue tracker or upload them to your team's storage.
- Customer data in logs: anonymise first, or keep the log inside your company's systems.
Want to try it? Open Online Clipboard. No account needed.
Official help pages
Device features and menu names change between versions. These official pages have the current details.