A tiny, client-side RF utility that runs in any modern browser. It converts:
- dBm โ mW
- mW โ dBm
- Frequency โ Wavelength (in free space)
- A simple mW โ dB relative to 1 W helper (see notes)
This is the HTML tool you placed at /db-calc.html
and also embedded on your portfolio homepage.
- Zero dependencies (plain HTML + JavaScript)
- Instant results, no backend
- Works offline
- Minimal UI that fits a portfolio site
- Formula: ( P_{\text{mW}} = 10^{\frac{P_{\text{dBm}}}{10}} )
- Example: 0 dBm โ 1 mW; 30 dBm โ 1000 mW
- Formula: ( P_{\text{dBm}} = 10 \log_{10}(P_{\text{mW}}) )
- Example: 1 mW โ 0 dBm; 0.1 mW โ โ10 dBm
- Formula: ( \lambda = \frac{c}{f} )
- Where: ( c = 299{,}792{,}458 ) m/s
- Units: ( f ) in Hz, ( \lambda ) in meters
- Example: 1 GHz โ 0.299792458 m
- Formula: ( f = \frac{c}{\lambda} )
- Units: ( \lambda ) in meters, ( f ) in Hz
- Example: 0.5 m โ 599,584,916 Hz (~0.6 GHz)
- Current formula in the tool:
10 * log10(1000 / mW)
This equals ( 30 - 10\log_{10}(P_{\text{mW}}) ) which is โdBW (dB relative to 1 W).- If you actually want dBW, use ( \text{dBW} = 10\log_{10}(P_{\text{W}}) = 10\log_{10}(P_{\text{mW}}) - 30 ).
- The current helper is useful when you want the attenuation to 1 W as a positive dB number.
โ If youโd like, I can switch this helper to output dBW directly and label it accordingly.
db-calc.html
โ Standalone page containing the UI and JS.
Just open the file in a browser:
# macOS
open db-calc.html
# Windows
start db-calc.html
# Linux (GNOME)
xdg-open db-calc.html