How to calculate parameter K in mosfet
The equation:

\$I_d= \frac K 2 (V_{gs}-V_t)^2\$  where  \$K=\mu C_{ox}\frac WL\$

describes the relation between \$I_d\$ and \$V_{gs}\$ when \$K\$ and \$V_t\$ are known and when the MOSFET operates in saturation mode. That means, \$V_{ds} &gt; V_{ds,sat}\$.

I you rewrite that equation to:

\$K= 2\frac {I_d} {(V_{gs}-V_t)^2}\$

it means that you would then need to know \$I_d\$, \$V_{gs}\$ and \$V_t\$

The way to "know" \$I_d\$ is that you measure it and/or you force the MOSFET to have that \$I_d\$.

Only if you have the values for \$I_d\$, \$V_{gs}\$ and \$V_t\$ and you know that the MOSFET operates in saturation mode can you calculate \$K\$.

So:

but what Id if I don't have the value of Id?

Then you cannot determine the value of \$K\$.

Generally you will not find a value for \$I_d\$ in a datasheet. There might be test conditions for a certain \$I_d\$ but often this is for linear mode (not saturation mode) as most discrete MOSFETs are used for switching applications where \$R_{ds,on}\$ is most important, and \$K\$ not so much.

The factor 2 depends on the definition of \$K\$, mostly used is:

\$K=\mu C_{ox}\frac WL\$

and then the 2 is needed in the equation for \$I_d\$

But if we use

\$K=\frac 1 2 \mu C_{ox}\frac WL\$

then the extra 2 isn't needed.

As  \$K=\mu C_{ox}\frac WL\$ is more common, I recommend sticking to that one.