Tool.Yun
Handy tools for developers
Barcode Reader
Barcode generator
GTIN Validator
QR Code decoder
QR Code generator
QR Contact Info generator
WiFi QR Code generator
tools.epc-qrcode-generator.name
Bash Cheatsheet
CSS Selectors Cheatsheet
Common Regex Cheatsheet
Docker Cheatsheet
Docker Compose cheatsheet
Docker SWARM cheatsheet
Dockerfile cheatsheet
Git Semantic Commit Cheatsheet
Git cheatsheet
JSONPath Syntax Cheatsheet
Jq Cheatsheet
K8s Cheatsheet
Markdown Cheat Sheet
Nano CheatSheet
Nginx Cheatsheet
Powershell Cheatsheet
Regex cheatsheet
Screen Command Cheatsheet
Sed cheatsheet
Tmux Command Cheatsheet
VIM Cheatsheet
XPath Syntax Cheatsheet
Zellij Command Cheatsheet
chmod Command Cheatsheet
Base64 Hex array encoder/decoder
Base64 file converter
Base64 string encoder/decoder
Csv to Data
Data Storage Unit converter
Email normalizer
Energy Consumption and Expense Computer
Env Variables Format Converter
Excel to data
Geographic Coordinates Converter
Integer base converter
Many Units Converter
Properties converter
Roman numeral converter
Text to UTF-8 binary
Text to Unicode
Torrent to Magnet
ULID generator
Unicode Characters to Java Entities Converter
dBm mW Converter
AGE Cryptography
Ansible vault crypt decrypt
Argon2 Hasher
Bcrypt
Bech32 Encoder/Decoder
CRC calculator
CSR Generator
Certificate/Key parser
ECDSA key pair generator
Ed25519 key pair generator
Encrypt / decrypt text
File Hasher
Hash text
Hmac generator
JWT Generator
JWT parser
Jasypt String Encryption
Niceware Bytes to Passphrase
PGP File Encryption
PGP encryption
PGP keygen
Paseto/PASERK Local
Paseto/PASERK Public/Private
RSA encryption
RSA key pair generator
RSA/DSA/ECDSA Signer and Verifier
SAML Parser
SSL Certificate converter
Shamirs Secret Sharing
X509 certificate generator
BMI Calculator
Calendar Converter
Credit Card Checker
Currency Converter
Explain Shell Command
IBAN validator and parser
IES Lighting Guidelines
ISBN Validator and Parser
ISO 3166 Country Codes Searcher
ISO 639 Searcher
Luhn Validator
Online Dictionary
Phone parser and formatter
RMB Uppercase Converter
Running Pace Calculator
SLA calculator
Software licence compatibility
Unicode Search
VAT Numbers Validator
Chronometer
Countdown
Cron/Weekday Alarm
Date+Durations Calculator
Date-time converter
Days Calculator
Duration Calculator
ETA calculator
ICAL File Parser
ICAL Generator
TTL calculator
Time Alarm
Timezone Converter
Week Numbers Converter
Which Day?
iCal Merger
Cron Expression Builder
ANSI Escape Tester
API Tester
CSS/JS Prettify & Minify
Cli command editor
Code/Scripts Highlighter
Curl Converter
Data Faker
Database Connection String Builder
Database Creation Builder
Database Table Generator
Django Secret Generator
Favicon Generator
File Splitter
GitIgnore Generator
Gitattributes Generator
HEX File Converter
Javascript Obfuscator
Javascript Prettifier
Javascript Unobfuscator/Unpacker
Json to Protobuf
Json to SQL INSERT
Json to Typescript
K6 Load Testing Script Generator
Mailto Generator
Open graph meta generator
Picomatch Tester
Pomodoro Timer
Quote Converter
SQL Minifier
SQL Parameters Generator
SQL prettify and format
Stacktrace prettier
String Escaper
Swagger UI tester
Docker Compose Format Converter
Docker Compose Validator
Docker Compose to .env file
Docker Compose to Docker run converter
Docker Compose to Quadlets
Docker Image Downloader
Docker Pangolin Labels
Docker compose to kubernetes
Docker inspect to Docker run
Docker run to Docker compose converter
Docker run to Quadlets
Docker run to kubernetes
Dockerfile Label Generator
Kubernetes RBAC Generator
Traefik Docker Compose Maker
Amortization Calculator
ActiveDirectory LDAP properties searcher
Bounce Email Parser
Cookies Parser
DMARC Report Analyzer
DNS Propagation Tester
DNS Tester
Dead Pixel Tester
EMV TLV decoder
ETH Transaction Decoder
Email Parser
File Type Detector
Floating point number converter
GZip/Deflate converter
HTTPS Tester
Hex Encoder/Decoder
Keycode info
MIME Encoding Converter
Middle-Endian Converter
MongoDB ObjectId Converter
Nmap Command Builder
Outlook MSG Parser
Outlook Safelink decoder
Parquet files Reader
RJ45 Cat6 Wiring Cheatsheet
Resistor Calculator
SMART Raw Converter
Sensitive data masker
Serial Port Console
Sharepoint Share Url Decoder
Short Urls Expander
Snowflake ID extractor
TCPDump Generator
Text Charset Detector/Decoder
URL Builder
URL parser
้”ฎ็›˜ๆต‹่ฏ•ๅ™จ
Card Picker
Coin Flipper
Dice Roller
Fortune wheel
BIP39 passphrase generator
Diceware Password Generator
NanoIDs generator
Numeronym generator
OTP code generator
Passphrase Generator
Pin Code Generator
Random numbers generator
Token generator
UUID converter
UUIDs generator
Camera recorder
Crop image
GIF to MP4
HEIC Converter
ICO/PNG converter
Image Color Inverter
Image Comparer
Image EXIF/Metadata/GPS/JPEG Quality reader
Image Formats Converter
Image resizer
Image to SVG (potrace)
OCRize image and PDF
Remove EXIF
Remove Image Background
SVG Previewer
Watermarker
CSV to JSON
JS to JSON converter
JSON Editor
JSON Flattener/Unflattener
JSON Linter
JSON Merger
JSON diff
JSON minify
JSON prettify and format
JSON sort master
JSON to .env
JSON to C#
JSON to CSV
JSON to Data
JSON to Go
JSON to JS converter
JSON to Java Entity
JSON to MessagePack
JSON to TOML
JSON to TS
JSON to XML
JSON to YAML converter
JSON to object
Jq/JSONPath Tester
Json Escaper/Unescaper
Json Query
Json Size Analyzer
Json string converter
Json to PHP Code
Json to PHP-Array
Json to Python
Json to SQL DDL
Json to Schema
Message Pack to JSON
ObjGen to JSON
PHP-Array to JSON
tools.json-patch.name
Epub to Markdown
Format Converter
HTML to markdown
Markdown Diff
Markdown Editor
Markdown Lorem Ipsum
Markdown Table Generator
Markdown Table Prettifier
Markdown preview
Markdown to DOCX
Markdown to HTML
Markdown to Text
Markdown to data
Markdown toc generator
Paste as Markdown
Binary Calculator
Math Formats Converter
Math OCR
Math evaluator
Tip calculator
Trigonometric/Equation Curve Visualizer
Aspect Ratio Calculator
Benchmark builder
Geo distance calculator
Percentage calculator
ARPA Decoder
Apache LogRotate Generator
BIMI DNS Generator
Basic auth generator
Chmod calculator
Cloudflare DNS/RDAP Queries
Crontab generator
Curl Command Generator
DKIM DNS Generator
DMARC DNS Generator
DNS Queries
DNSBL Checker
Data Transfer Rate Calculator
FStab Generator
HAR Sanitizer
HDD calculator
HTAccess generator
Htpasswd/htaccess generator
IP Geo Location
IP Subnets Exclude Calculator
IPv4 Subnets Lister
IPv4 address converter
IPv4 range expander
IPv4 subnet calculator
IPv4-6/IPRange/CIDR in IPRange/CIDR/IPMask
IPv4/6 Range to CIDR(s) Calculator
IPv6 ULA generator
Integers to IPv4/IPv6
Iptables Generator
Ipv4/6 CIDR to IP Range Calculator
Ipv6 address converter
Ipv6 subnet calculator
MAC Address Converter
MAC address generator
MAC address lookup
Microphone Tester
Multi link downloader
My IP Address
Nginx formatter
Option43 generator
PTR DNS Generator
Password strength analyser
Ping
Port Numbers
Punycode Converter
RAID Calculator
RAID Reliability Calculator
Random port generator
Restic Command Generator
Rsync Generator
SIP Authorization
SPF DNS generator
Shell Commands Formatter
Shell Commands Linearizer
Shutdown Command Generator
TCP/UDP Port Tester
UFW Command Generator
Visual Subnet Calculator
WPA PSK generator
Websocket tester
Whois Checker
Wireguard Config Generator
X-VR-SpamCause Decoder
ZPOOL RAID calculator
ZPool Cheatsheet
Zxcvbn Password Strength
firewalld command line generator
tools.url-redirection-checker.name
HTML to PDF
PDF Compressor
PDF Text Extractor
PDF signature checker
Pdf Concatener
Pdf Decrypt and Unlock
Pdf Encrypt
Pdf Linearize/FastWeb
Pdf Page Extractor
Acceleration Converter
Angle Units Converter
Area Units Converter
Energy Units Converter
Fitness Computer
Food Energy Converter
Force Units Converter
Frequency Converter
Illuminance Converter
Length Units Converter
Mass Units Converter
Power Converter
Pressure Units Converter
SI Prefixes Converter
Speed Converter
Temperature converter
Volume Flow Rate Converter
Volume Units Converter
TOML Linter
TOML to JSON
TOML to YAML
AI Prompt Splitter
ASCII Art Text Generator
Case converter
Citation Generator
Distinct Words
Duplicate Lines Finder
Emoji picker
Extract text from HTML
Folder Structure Diagram
Font Compare
GPT Token Encoder/Decoder
GPT Token Estimator
I and L Checker
Image to ASCII Art
JSON to TOON
Keyboard Layout Converter
Levenshtein Calculator
List converter
Lists Comparer
Lorem ipsum generator
Mermaid exporter
Morse Code Converter
Pack files for AI
RSVP Reader
Random Line Picker
Regex Tester
Rune converter
Sed Command generator
Smart Text Replacer and Linebreaker
Social Link Sharer
String obfuscator
TOON to JSON
Tab to Spaces
Text Translator
Text diff
Text statistics
Text to NATO alphabet
Text to Unicode Names
Unicode Formatter
Unicode to GSM-7
Zalgo Generator/Banner
CSS Gradient Generator
CSS Units Converter
CSS XPath Converter
Color Contrast Checker
Color Wheel
Color converter
Css prettifier
Device information
Encode/decode url formatted strings
Escape HTML entities
HTML Minifier
HTML Prettifier
HTML WYSIWYG editor
HTML cleaner
HTML to XHTML
HTML to data
HTTP status codes
Image to CSS
MIME types
REM Pixel converter
SVG placeholder generator
Slugify string
UTM Url Generator
Url Cleaner
Url Fanger
Url Text Search Fragment Maker
User-agent parser
ObjGen to HTML
XML Linter
XML formatter
XML to JSON
XPath Tester
XSLT tester
YAML Flattener/Unflattener
YAML Merger
YAML prettify and format
YAML to JSON converter
YAML to TOML

XPath Syntax Cheatsheet

XPath Syntax Cheatsheet

XPath navigates an XML or HTML document as a tree. Every step has the form axis::node-test[predicate], and most of it has a short form: //div[@class="card"]/a/@href reads โ€œthe href of every a inside any div with class cardโ€.

โš ๏ธ Browsers, Selenium and most scrapers implement XPath 1.0. ends-with(), matches(), lower-case() and replace() are 2.0+ and only work in tools like xmllint, Saxon or lxml with an XSLT 2.0 processor. Workarounds for 1.0 are given below.

๐Ÿงญ Path Syntax

XPathSelects
/From the document root โ€” an absolute path
//Anywhere in the document, at any depth
.The current (context) node
..The parent of the context node
@attrAn attribute
*Any element
@*Any attribute
text()The text nodes of an element
node()Any node at all, text and comments included
[n]The nth match โ€” 1-based, not 0-based
[last()]The last match
a | bThe union of two expressions
/html/body            (: absolute: the body of the page :)
//text()              (: every text node :)
./div/b               (: relative to the context node :)
(//p)[2]              (: the second p in the whole document :)
//p[2]                (: every p that is the second p of its parent :)

๐Ÿท Elements & Attributes

XPathDescriptionCSS
//EEvery <E> elementE
(//E)[2]The second <E> in the documentโ€”
//E[@A]<E> carrying attribute AE[A]
//E[@A="t"]<E> where A is exactly tE[A='t']
//E[contains(@A,"t")]<E> where A contains tE[A*='t']
//E[starts-with(@A,"t")]<E> where A starts with tE[A^='t']
//E[substring(@A, string-length(@A)-2)="t"]<E> where A ends with t (1.0 trick)E[A$='t']
//E[ends-with(@A,"t")]The same, XPath 2.0+ onlyE[A$='t']
//E[matches(@A,"r")]A matches regex r (2.0+)โ€”
//E/@AThe value of attribute Aโ€”
//*/@AAttribute A of any elementโ€”
//E[@A2="t"]/@A1A1 where A2 is tโ€”
//E1[@id="I1"] | //E2[@id="I2"]Either elementE1#I1, E2#I2
//E[@id="I1" or @id="I2"]<E> with either idE#I1, E#I2

๐Ÿ†” Id, Name, Class & Language

XPathDescriptionCSS
//*[@id="I"]The element with id I#I
//E[@id="I"]<E> with id IE#I
//*[@name="N"]Any element named N[name='N']
//*[@name="N"][@value="v"]Named N with value v[name='N'][value='v']
//*[contains(concat(" ", normalize-space(@class), " "), " C ")]Element with class C โ€” the padding avoids matching C2.C
//E[contains(concat(" ", normalize-space(@class), " "), " C ")]<E> with class CE.C
//E[@lang="L" or starts-with(@lang, concat("L","-"))]<E> in language L or a subcodeE[lang|='L']

๐Ÿ“ Text & Links

XPathDescriptionCSS
//*[.="t"]Element whose whole text is exactly tโ€”
//E[contains(text(),"t")]<E> with a text node containing tโ€”
//E[contains(.,"t")]<E> whose text, descendants included, contains tโ€”
//E[normalize-space()="t"]Exact text, ignoring surrounding whitespaceโ€”
//aEvery linka
//a[.="t"]The link labelled exactly tโ€”
//a[@href="url"]The link pointing at urla[href='url']
//a[.="t"]/@hrefThe URL behind the label tโ€”
//a[starts-with(@href,"https")]Secure links onlya[href^='https']

๐Ÿ‘ช Parents & Children

XPathDescriptionCSS
//E/*[1]First child of <E>E > *:first-child
//E/*[last()]Last child of <E>E > *:last-child
//E[1]Each <E> that is the first of its type in its parentE:first-of-type
//E[last()]Last <E> of its typeE:last-of-type
//E[2]Second <E> of its typeE:nth-of-type(2)
//*[2][name()="E"]Second child, if it is an <E>E:nth-child(2)
//E[last()-1]Second-to-last <E> of its typeE:nth-last-of-type(2)
//E/..The parent of <E>โ€”
//div/form/parent::*Every element that has a form childdiv:has(> form)
//*[@id="I"]//E<E> anywhere under id I#I E
//E[count(*)=0]<E> with no element childrenE:empty
//E[count(*)=1]<E> with exactly one childโ€”
//E[count(preceding-sibling::*)+count(following-sibling::*)=0]<E> that is an only childE:only-child
//E[count(../E)=1]<E> with no <E> siblingsE:only-of-type
//E1[E2 and not(*[not(self::E2)])]<E1> whose only children are <E2>โ€”
//E[position() mod N = M + 1]Every Nth element, offset by ME:nth-child(Nn+M)

๐Ÿ‘ฅ Siblings

XPathDescriptionCSS
//E2/following-sibling::E1Every <E1> after a sibling <E2>E2 ~ E1
//E2/following-sibling::*[1][name()="E1"]<E1> immediately after <E2>E2 + E1
//E2/following-sibling::*[2][name()="E1"]<E1> two siblings after <E2>E2 + * + E1
//E/following-sibling::*[1]Whatever follows <E> directlyE + *
//E2/preceding-sibling::E1Every <E1> before a sibling <E2>โ€”
//E2/preceding-sibling::*[1][name()="E1"]<E1> immediately before <E2>โ€”
//E/preceding-sibling::*[1]Whatever precedes <E> directlyโ€”

๐Ÿ“Š Tables & Form State

XPathDescriptionCSS
//*[@id="T"]//tr[3]//td[2]Third row, second cell#T tr:nth-child(3) td:nth-child(2)
//td[preceding-sibling::td="t"]The cell right after the one reading tโ€”
//td[preceding-sibling::td[contains(.,"t")]]Cells following one containing ttd:has(~ td)
//table[count(tr)=1 and count(tr/td)=2]Tables with one row and two columnsโ€”
//table/tr[last()]The last row of a tabletable tr:last-child
//E[@disabled]A disabled controlE:disabled
//E[not(@disabled)]A control that is not disabledE:enabled
//*[@checked]A checked checkbox or radio:checked

๐Ÿงฎ Functions

Strings

FunctionReturns
contains(haystack, needle)True when the first string contains the second
starts-with(haystack, needle)True when it starts with it
concat(s1, s2, โ€ฆ)The strings joined together
normalize-space(s)The string with runs of whitespace collapsed and trimmed
string-length(s)The number of characters
substring(s, start [, length])A slice โ€” 1-based
substring-before(haystack, needle)Everything before the first occurrence
substring-after(haystack, needle)Everything after it
translate(s, from, to)Characters mapped one by one โ€” the 1.0 way to fold case

Numbers, logic & nodes

FunctionReturns
count(node-set)How many nodes matched
sum(node-set)The sum of their numeric values
position()The index of the context node within its step
last()The size of the context โ€” so [last()] is the final node
name([node-set])The qualified name of the first node
namespace-uri([node-set])Its namespace URI
lang(s)True when the node is in that language
not(expr)The negation
true() / false()Boolean constants
boolean(expr) / string(o) / number(o)Type conversions
ceiling(n) / floor(n) / round(n)Rounding

๐Ÿ’ก Case-insensitive matching in XPath 1.0: //E[contains(translate(@A,"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz"), "t")]

๐Ÿงญ Axes

AxisShort formSelects
child(default)The direct children of the context node
descendant//Every node below the context node
descendant-or-self//The context node and everything below it
parent..The single parent node
ancestorโ€”Parent, grandparent, up to the root
ancestor-or-selfโ€”The same, including the context node
followingโ€”Everything after the node in document order, except descendants
following-siblingโ€”Later siblings under the same parent
precedingโ€”Everything before it, except its ancestors
preceding-siblingโ€”Earlier siblings under the same parent
attribute@The attributes of the node
self.The context node itself
//td[.="Total"]/ancestor::table          (: the table a cell belongs to :)
//h2[.="Specs"]/following-sibling::ul[1] (: the list after a heading :)
//input[@name="q"]/ancestor-or-self::form (: the form wrapping a field :)

๐Ÿง  Worked Examples

//hr[@class="edge" and position()=1]
(: the first hr of class 'edge' under each parent :)

//table[parent::div[@class="pad"] and not(@id)]//a
(: links in unnamed tables inside a padded div :)

/html/body/div/*[preceding-sibling::h4]
(: whatever comes after an h4 :)

//tr/td[font[@class="head" and text()="TRACK"]]
(: cells whose font child says TRACK :)

//*[count(*)=3]
(: elements with exactly three children :)

//rdf:Seq/rdf:li/em:id
(: namespaced elements โ€” the prefixes must be bound by the host tool :)

//var | //acronym
(: a union of two node sets :)

๐Ÿ›  Running XPath

// browser devtools console
$x('//a[contains(@href, "docs")]');

// plain DOM API
document.evaluate('//h1', document, null, XPathResult.ANY_TYPE, null).iterateNext();
# from the shell, over XML or HTML
xmllint --xpath '//book/title/text()' catalog.xml
xmllint --html --xpath '//a/@href' page.html 2>/dev/null
from lxml import html
tree = html.parse('page.html')
tree.xpath('//div[@class="card"]/a/@href')
# Selenium and Playwright both accept XPath locators
driver.find_element(By.XPATH, '//button[normalize-space()="Save"]')
page.locator('xpath=//button[normalize-space()="Save"]').click()

โš ๏ธ Notes

  • Indexes start at 1. [0] never matches anything.
  • //E[1] is per-parent, (//E)[1] is document-wide โ€” the single most common XPath bug.
  • Namespaced documents need prefixes registered with the host library; in XPath 1.0 a common workaround is //*[local-name()="title"].
  • // is expensive on large documents; anchor the path when you can.
  • Prefer text matching with normalize-space() โ€” HTML is full of stray whitespace and line breaks.

๐Ÿ“š Resources

  • MDN โ€” XPath
  • MDN โ€” XPath functions
  • XPath 1.0 specification
  • XPath cheat sheet (alephzarro)

Credit to the original author: https://gist.github.com/jmaccabee/550a0b9fcfdc7e6b170cd34c6ec7bc56