Help帮助
Everything Napkin understands, with a working example for each. You never have to memorize any of it — plain arithmetic works from the first line, and the rest is here when you need it. Napkin 认得的所有写法,每条都配一个真实可跑的例子。 不需要背——直接写算术就能用,剩下的等要用时回来查。
01Getting started上手
Press ⌥Space anywhere to bring Napkin up. Type one thing per line; the answer appears on the right as you type. Press Esc to put it away — focus returns to whatever you were doing. 在任何地方按 ⌥Space 呼出 Napkin。 一行写一件事,右边随打随出结果。按 Esc 收起, 焦点回到你刚才那个窗口。
2 + 3 × 414price = $12/user$12/user40 users × price$480.002 + 3 × 414单价 = ¥12/user¥12/人40 users × 单价¥480.00A line that isn't a calculation is just a note — write whatever you want between the numbers. Incomplete lines stay silent instead of flashing an error at you mid-keystroke. 不是算式的行就当注解,数字之间想写什么写什么。 没写完的行会保持安静,不会打到一半就红给你看。
02Numbers & math数字与运算
| Write写法 | What it does作用 |
|---|---|
+ - × ÷ ^ |
* and / work too, as does the fullwidth +
* / 也行,全角 + 也认 |
1,250,000 |
Thousands separators are ignored — commas or spaces 千分位随便写,逗号或空格都忽略 |
1.5k · 2M · 3B |
Scale suffixes. Case matters: 2M is two million, 2m is two metres
量级后缀。区分大小写:2M 是两百万,2m 是两米 |
0xFF · 0b1010 · 0o17 |
Hex, binary, octal十六 / 二 / 八进制 |
& | xor << >> |
Bitwise operators位运算 |
Functions: sqrt abs round floor ceil min max sin cos tan log ln log2 exp
函数:sqrt abs round floor ceil min max sin cos tan log ln log2 exp
(2+3)^2250xFF255max(3, 7)70.1 + 0.20.3
That last one is not a typo. Napkin does money in fixed-point decimal,
so 0.1 + 0.2 is 0.3 — not 0.30000000000000004.
最后一行不是笔误。Napkin 用定点十进制算钱,
0.1 + 0.2 就是 0.3,不是 0.30000000000000004。
03Units单位
Write the unit next to the number and Napkin carries it through the whole calculation. This is the part that catches mistakes: units that don't match refuse to combine instead of quietly producing a number. 把单位写在数字旁边,Napkin 会让它跟着整个算式走。 拦错就靠这个:单位对不上时它拒绝计算,而不是安静地给你一个数。
Converting换算
Use in, to, as or into.
用 换、换算成、转成,英文写 in / to。
10 km in miles6.21 mi1.5 TB in GB1,500 GB1000 JPY to USD$6.5225 celsius in fahrenheit77 °F10 km 换 miles6.21 mi1.5 TB 换 GB1,500 GB1000 日元 换人民币¥46.5225 摄氏度 换华氏度77 °FExchange rates are fetched daily and cached. Everything else (length, mass, data, time) is an exact definition and works offline. 汇率每天取一次并缓存。其他的(长度、质量、数据、时间) 都是精确定义,离线一样算。
Compound units复合单位
Divide units to build rates, and they cancel the way they should.
Napkin cancels by dimension, not by name — so users against
user still cancels.
用除号构造速率,该约掉的会约掉。
Napkin 按量纲约分而不是按名字,所以 users 和
user 也能对上。
100 GB / 30 day3.33 GB/day12,000 users/day × $39/user$468,000/day1 GB / 1 day in MB/hour0.01 MB/h100 GB / 30 day3.33 GB/天12,000 users/day × ¥39/user¥468,000/天1 GB / 1 day 换 MB/hour0.01 MB/hWhen units don't match单位对不上时
100 users + $50can't add users and USD — different dimensions100 users + ¥50users 和 CNY 量纲不同,不能相加What it knows认得哪些单位
| Money货币 | $ ¥ € £ · USD CNY EUR JPY … |
| Counting计数 | user users · order · time
· 人 · 次 |
| Time时间 | s min h day week month year
· 秒 分 时 天 周 月 年 |
| Data数据 | B KB MB GB TB · KiB MiB GiB |
| LLM大模型 | token tokens · Mtok |
| Physical物理量 | length, mass, temperature — m km mi ft, g kg lb, °C °F
长度、质量、温度 —— 米 公里 英里、克 千克 磅、摄氏度 华氏度 |
04Percentages百分比
"Up 12%" and "up 0.61 points" are different claims, and mixing them up is how a deck ends up wrong. Napkin keeps them apart. 「涨了 12%」和「涨了 0.61 个点」是两回事,混着说汇报就错了。 Napkin 把这两个分得很清楚。
20% of $10$2.005% on $30$31.5020% off 40 EUR€32.00200 + 15%230800 → 920+15%5% + 0.61pp5.61%800 的 12%965% on $30$31.506% off 40 EUR€37.60200 + 15%230800 → 920+15%120 是 800 的百分之几15%5% + 0.61pp5.61%
+ 15% means relative (a 15% increase).
+ 0.61pp means absolute (add 0.61 percentage points).
Use pp whenever you mean points.
+ 15% 是相对变化(涨 15%)。
+ 0.61pp 是绝对变化(加 0.61 个百分点)。
说「点」的时候一律写 pp。
05Variables变量
Name your assumptions instead of scattering raw numbers.
Change one and everything below recomputes. Both = and
: work; names can be in any language and can contain spaces
(monthly cost, AI bill).
给假设起名字,别把裸数字撒得到处都是。改一个,下面全部重算。
= 和 : 都行,名字可以用中文,也可以带空格
(monthly cost、AI bill)。
DAU = 12,000 users/day12,000 users/dayARPU = $39/user$39/userrevenue: DAU × ARPU × 30 day$14,040,000.00prev / 30 day$468,000/day日活 = 12,000 users/day12,000 人/天客单价 = ¥39/user¥39/人月收入: 日活 × 客单价 × 30 day¥14,040,000.00prev / 30 day¥468,000/天prev |
The result of the line above上一行的结果 |
sum |
Sum of the lines you have selected当前选中那几行的和 |
average |
Average of the selected lines选中那几行的平均 |
Select a few lines and the total appears at the bottom — no need to
write sum at all. There is deliberately no whole-document total:
most drafts have several unrelated calculations in them, and summing all of
them produces a meaningless number.
选中几行,底部直接出合计,连 sum 都不用写。
刻意不做全文档合计——一张草稿上通常有好几段互不相干的账,
全加起来是个没有意义的数。
06Dates & time日期与时间
today + 45 days2026-09-04today + 10 workdays2026-08-042026-09-01 − today42 days2h 30min + 45min3h 15minfromunix(1784505600)2026-07-20 00:00 UTC今天 + 45 天2026-09-04今天 + 10 个工作日2026-08-042026-09-01 − 今天42 天2h 30min + 45min3h 15min本月还剩几天10 天
Month and year arithmetic is calendar-aware: adding one month to
Jan 31 lands on Feb 28, not Mar 3. Time zones work too —
now in PST.
月和年的加减按日历走:1 月 31 日加一个月落在 2 月 28 日,
而不是 3 月 3 日。时区也认,写 now in PST 或 北京时间。
07A/B testingA/B 实验
Give it the two arms and it runs a two-proportion z-test: the lift, the p-value, and a straight verdict on whether the difference could just be noise. 给它两组数据,它跑双比例 z 检验:提升幅度、p 值, 以及一个直接的结论——这个差异是不是可能纯属噪声。
abtest(4820, 116, 4790, 144)+24.92% / p=0.0701 ✗ not significantA: 4820, 116—B: 4790, 144+24.92% / p=0.0701 ✗ not significantabtest(4820, 116, 4790, 144)+24.92% / p=0.0701 ✗ 不显著A: 4820 中 116—B: 4790 中 144+24.92% / p=0.0701 ✗ 不显著
Arguments are exposures A, conversions A, exposures B, conversions B.
The A: line stays silent by design — the comparison only exists once
there's a second arm.
参数顺序是 曝光A, 转化A, 曝光B, 转化B。
A: 那行故意不出结果——有了第二组才谈得上比较。
Planning a test开跑之前
samplesize(2.4%, 10%)66,944 per arm (133,888 total)mde(2.4%, 5000)+38.9%DAU = 12k users/day12,000 users/daysamplesize(2.4%, 10%) users / DAU11.2 day样本量(基线 2.4%, 提升 10%)每组 66,944(共 133,888)mde(基线 2.4%, 每组 5000)+38.9%日活 = 12k users/day12,000 人/天样本量(2.4%, 10%) users / 日活11.2 天
samplesize answers "how many do I need?";
mde answers the reverse — "with the traffic I have, how big does the
effect need to be before I could detect it?" Both assume 80% power and α = 0.05.
If you divide by a literal rate rather than a variable, parenthesize it:
/ (12k users/day) — otherwise day reads as a second division.
样本量 回答「我需要多少人」;mde 回答反过来的问题
——「就这么点流量,效果得多大我才看得出来」。两者都按 80% 功效、α = 0.05 算。
除数如果直接写成带单位的字面量,要加括号:/ (12k users/day)——
不加的话 day 会被当成又一次除法。用变量名就没这个问题。
Two-tailed only. One-tailed tests halve the p-value and are the most common way an experiment gets talked into looking significant. Napkin doesn't offer them. 只做双尾。单尾把 p 值砍一半,是把实验「说成」显著的最常见入口。 Napkin 不提供这个选项。
08Uncertainty区间估算
You rarely know ARPU exactly. Write the range with ±
(or +-) and Napkin carries it all the way down, so the final
number admits how rough it is.
客单价你从来就不知道确切值。用 ±(或 +-)
写下浮动范围,Napkin 会一路带到底,最后那个数会老实告诉你它有多粗。
ARPU = 39 $/user ± 15%$39/user ± 15%conv = 3% ± 0.5pp3% ± 0.5ppDAU = 12k users/day12,000 users/dayDAU × conv × ARPU × 30 day$421,200.00 ± 94,444.44客单价 = 39 ¥/user ± 15%¥39/人 ± 15%转化率 = 3% ± 0.5pp3% ± 0.5pp日活 = 12k users/day12,000 人/天日活 × 转化率 × 客单价 × 30 day¥421,200.00 ± 94,444.44Errors combine as root-sum-square, not by adding up. Adding them linearly assumes every assumption is wrong in the same direction at once, which explodes the range as soon as you have more than two or three variables. 误差按平方和开根合成,而不是直接相加。 线性相加等于假设所有假设同时朝一个方向错, 变量一多,区间就炸得没法看了。
Write the unit on the number, before the ±.
39 $/user ± 15% works; 39 ± 15% $/user does not
parse the way you'd expect.
单位要写在数字上,写在 ± 前面。
39 ¥/user ± 15% 可以;39 ± 15% ¥/user 解析结果和你想的不一样。
09Shortcuts快捷键
| ⌥Space | Show or hide Napkin, from anywhere在任何地方呼出或收起 |
| ⌥⇧Space | Open a fresh draft新建一张草稿 |
| Esc | Put it away, return focus收起,焦点还给刚才那个 App |
| ⌘T | New tab新标签页 |
| ⌘W | Close tab关闭标签页 |
| ⌘⇧C | Copy the current line's result复制当前行的结果 |
| ⌘⇧A | Copy the whole draft, results aligned复制整份草稿,算式与结果对齐 |
| ⌘⇧M | Copy as a Markdown table复制成 Markdown 表格 |
| ⌘, | Settings设置 |
10Known limits已知限制
Things Napkin currently gets wrong or doesn't do. Listed here rather than left for you to discover mid-calculation. Napkin 目前做不到或者会做错的地方。写在这里, 省得你算到一半才发现。
39 ± 15% $/user |
Unit after the ± is misread. Write 39 $/user ± 15%
单位写在 ± 后面会解析错。写成 39 ¥/user ± 15% |
| Solving for a variable反解变量 | Only simple cases. There's no general equation solver yet 只支持简单情形,还没有通用方程求解 |
| Line references行号引用 | Absolute references shift when you insert a line above. Use named variables 在上方插入一行,绝对引用就错位了。用变量名代替 |
| Model price tables模型价格表 | Not built in, on purpose — a stale price table is worse than no table 刻意不内置——过期的价格表比没有更危险 |
| Windows / LinuxWindows / Linux | macOS only for now. The engine is portable; the app shell isn't yet 目前只有 macOS。引擎是跨平台的,壳还不是 |
Found something else? Open an issue. 发现别的问题?提个 issue。