tools

JsonLogic to SQL converter

Paste a JsonLogic rule and get the equivalent WHERE clause for your database.

  • free
  • no sign-up
  • runs in your browser
  • MIT
input · JsonLogic
output · SQL
5 rules · 5 fields · converted Runs in your browser: nothing leaves it.

How it converts

Each JsonLogic operation becomes a qnot rule: == and != are equality, <, <=, >, >= comparisons, a three-argument <= is BETWEEN, in over a list is IN and in over a string is a contains (LIKE with escaped wildcards).

! and !! read as "is empty" and "is not empty", which SQL writes as a NULL-or-empty check. Lists tested with some, all and none become array conditions.

Use it in your app

follows your input and settings

The converter is qnot's codecs. Declare the fields once and the same two calls run on your server or in the browser, typed end to end.

Questions

Is my query sent anywhere?
No. The converter is qnot running in your browser: parsing, schema inference and conversion all happen on this page, and nothing you paste leaves your browser.
Which JsonLogic operations are supported?
and, or, !, !!, ==, ===, !=, !==, <, <=, >, >=, in, some, all, none, startsWith, endsWith and var. Arithmetic, map/reduce over values, if and custom operations have no WHERE equivalent and are reported as errors.
Why does it show a schema?
qnot's codecs are typed by a schema. The tool infers a permissive one from your input (numbers, booleans, dates, lists, nested arrays), so you can paste any query. In your app you declare the fields once with defineFields and get the same conversion with exact types.